Skip to main content

Order placement

Data Flow

note

For the sake of simplicity we omitted any security handshakes between Shopboxo, Super app and Merchant store

shopify order flow


How to differentiate Mini program orders?

All orders coming from Mini program will be assigned a tag with name of the Super app

shopify orders

API reference

Get or create Miniapp cart API

curl --location --request POST '{{DOMAIN}}/rest/mp_storeview/V1/customers/{{customer_id}}/carts/' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}'
note

mp_storeview in url indicates that magento should create a separate cart from the one being used on main website

Create order API

curl --location --request PUT '{{DOMAIN}}/rest/V1/carts/{{cart_id}}/order' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"paymentMethod": {
"method": "miniapppayment"
}
}'

Invoice order API

curl --location --request POST '{{DOMAIN}}/rest/V1/order/{{order_id}}/invoice' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"capture": true,
"notify": true
}'

Set payment id API (sent along side invoice request)

curl --location --request PUT '{{DOMAIN}}/rest/V1/orders/{{order_id}}/set-order-paymentid' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"orderPaymentId": "{{superapp_payment_id}}"
}'

Cancel order API

curl --location --request POST '{{DOMAIN}}/rest/V1/orders/{{order_id}}/cancel/' \
--header 'Authorization: Bearer {{ACCESS_TOKEN}}'