Integration Guide & API Reference

Follow the below instructions to accomplish an intention

πŸ‘

Note :

Download the Postman collection from this link

Create Intention API

URL: <https://oman.paymob.com/v1/intention/>
Method: POST
source: Merchant's server
recipient: Paymob's server
Content: JSON

authorization-header: Token <secret_key>

{
    "amount": 10,
    "currency": "OMR",
    "payment_methods": ["card","omannet"],
    "items": [
    {
    "name": "Item name 1",
    "amount": 10,
    "description": "Watch",
    "quantity": 1
    }
    ],
    "billing_data": {
    "apartment": "6",
    "first_name": "Ammar",
    "last_name": "Sadek",
    "street": "938, Al-Jadeed Bldg",
    "building": "939",
    "phone_number": "+96824480228",
    "country": "OMN",
    "email": "[email protected]",
    "floor": "1",
    "state": "Alkhuwair"
    },
    "customer": {
    "first_name": "Ammar",
    "last_name": "Sadek",
    "email": "[email protected]",
    "extras": {"re":"22"}
    },
    "extras": {"ee":22}
}
{
    "payment_keys": [
    
        {
            "integration": 114,
            "key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "gateway_type": "OMANNET",
            "iframe_id": null
        }
    ],
    "id": "pi_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "intention_detail": {
        "amount": 10,
        "items": [
            {
                "name": "Item name 1",
                "amount": 10,
                "description": "Watch",
                "quantity": 1
            }
        ],
        "currency": "OMR"
    },
    "client_secret": "pak_csk_test_xxxxxxxxxxxxxxxxxxxxxxxxx",
    "payment_methods": [
        {
            "integration_id": 104,
            "alias": null,
            "name": "card",
            "method_type": "online",
            "currency": "OMR",
            "live": false
        },
        {
            "integration_id": 114,
            "alias": null,
            "name": "omannet",
            "method_type": "online",
            "currency": "OMR",
            "live": false
        }
    ],
    "special_reference": null,
    "extras": {
        "creation_extras": {
            "ee": 22
        },
        "confirmation_extras": null
    },
    "confirmed": false,
    "status": "intended",
    "created": "2023-09-07T15:48:04.446108+05:00",
    "card_detail": null,
    "object": "paymentintention"
}

🚧

Note!

You can get secret_key and public_key from Merchant Dashboard.

secret_key :sk_test_626ba4a60a6f9cf4b0bc066ad3de884e93693afd5218ef832e99cbdf76a0fb37

public_key: pk_test_yl9JpHlmLY17jAL16yWU4y2zlpke14pO

client_secret_key: It can be obtained from the response of create intention API

Retrieve Intention API

URL: https://oman.paymob.com/v1/intentionv1/intention/element/><public_key/<client_secret_key>
Method: GET
source: Merchant's server
recipient: Paymob's server
Content: JSON

{
    "id": "pi_test_032a80985a0d4df78154b6e135e5b40c",
    "intention_detail": {
        "amount": 50,
        "items": [
            {
                "name": "Item name",
                "amount": 50,
                "description": "Item description",
                "quantity": 1
            }
        ]
    },
    "client_secret": "csk_test_32e9a7b0472a75b7d7baeb09e47a83fa",
    "payment_methods": [
        {
            "id": "pm_test_8792bf52846b47bfa9df25b32d02bc9c",
            "integration_id": "25",
            "alias": null,
            "name": "Card",
            "type": "online",
            "currency": "OMR",
            "live": false,
            "object": "paymentmethods"
        }
    ],
    "transactions": [],
    "special_reference": null,
    "transaction_records": [],
    "extras": {
        "creation_extras": {
            "billing_data": {
                "city": "dumy",
                "email": "[email protected]",
                "floor": "dumy",
                "state": "dumy",
                "street": "dumy",
                "country": "dumy",
                "building": "dumy",
                "apartment": "dumy",
                "last_name": "dumy",
                "first_name": "dumy",
                "phone_number": "+96824480228"
            }
        },
        "confirmation_extras": null
    },
    "confirmed": false,
    "customer": null,
    "status": "intended",
    "created": "2023-01-24T10:38:41.685849+02:00",
    "object": "paymentintention",
    "merchant_name": "561338211",
    "merchant_id": 13,
    "user_username": "ae409abb630c4f53ad1ecfd71efa3a16",
    "user_id": 10,
    "payment_keys": {
        "live": false,
        "card": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx="
    },
    "is_card_expired": false
}

🚧

Note!

Once you done with the Intention you need to call this URL. It will open in browser's window.

Unified URL https://oman.paymob.com/unifiedcheckout/?publicKey=<key&clientSecret=<client_key>>


What’s Next