How to use your own checkout

API Order management

To release the order for payment with your checkout link on OmniChat, you must call the provisions API as shown in the example below:

In case of success

curl --location 'https://orders-api.omni.chat/v2/orders/{ORDER_ID}/provisions' \
--header Authorization:Bearer r:exemplodeapisecret2014 \
--header 'Content-Type: application/json' \
--data '{
    "responsible": "personResponsible",
    "code": 200,
    "message": "Order is ready for payment",
    "checkoutUrl": "https://checkout.omni.chat/order/123"
}'

In case of failure

curl --location 'https://orders-api.omni.chat/v2/orders/{ORDER_ID}/provisions' \
--header Authorization:Bearer r:exemplodeapisecret2014 \
--header 'Content-Type: application/json' \
--data '{
    "responsible": "personResponsible",
    "code": 400,
    "message": "Failure to provision the order",
}'

Request parameters

responsible

This parameter is mandatory and refers to who requested this provision.

code

This parameter is mandatory and refers to the provisioning status, 200 in case of success and 400 in case of failure.

message

This parameter is mandatory.

checkoutUrl

This parameter is optional and refers to your checkout link.

🚧

If your checkout allows the customer to change items, discount, address, shipping, it is necessary to synchronize this data with OmniChat (See how to perform this procedure in How to sync my order with OmniChat).