Acknowledgement API Reference

When an order is done being processed on the Commerce Platform (fraud checks, remorse period, ...), its state will be changed to CREATED automatically. Acknowledging an order confirms that you have moved the order into your Order Management System and are ready to fulfill it. Acknowledging an order changes its state to IN_PROGRESS.

By default, your shop will be configured to automatically move orders to the IN_PROGRESS state when finalized. To enable order acknowledgement, you must first associate your shop with your app. This one-time operation is recommended if you are planning to fulfill orders using the API, and will leave finalized orders in the CREATED state until you acknowledge them.

In this section:

Associate Commerce Merchant Settings with your App

In order to manage orders via API, an App must first be associated with the Commerce Merchant Settings representing your shop. This action only needs to be performed once, and instructs the Commerce Platform to leave finalized orders in the CREATED state for you to acknowledge.

POST https://graph.facebook.com/vX.X/{cms-id}/order_management_apps?access_token=PAGE_ACCESS_TOKEN

Request

AttributeTypeDescription

cms-id

string

Commerce merchant settings ID for the page that you want to extract orders. You can find {cms-id} by logging into Facebook Commerce Manager and then select the page that you want to extract orders. You will be redirected to www.facebook.com/ commerce_manager/{cms-id}

Sample Response

{
    "success": true
}

Acknowledge One Order

Acknowledge one specific order that was retrieved using the List Orders API. This action marks the order as IN_PROGRESS, and can be filtered out from future pulls.

Be sure to capture errors, take action according to the error messages, and retry accordingly. Do not start processing orders in your systems that have not been successfully acknowledged.

POST https://graph.facebook.com/vX.X/{order-id}/acknowledge_order?access_token={PAGE_ACCESS_TOKEN}

Request

AttributeTypeRequiredDescription

merchant_order_reference

string

Optional

ID representing the order in

your order management system.

idempotency_key

string

Required

A unique key per request

Sample Request

{
  "idempotency_key": "cb090e84-e75a-9a34-45d3-5163bec88b65",
  "merchant_order_reference": "external_order-id-1"
}

Sample Response

{
  "id": "64000841784004",
  "state": "IN_PROGRESS"
}

Acknowledge Multiple Orders

Acknowledge order batches have a maximum of 100 orders per batch.

Acknowledge orders that were received by the List Orders API, in a batch. This action marks orders as IN_PROGRESS, and can be filtered out from future pulls.

POST https://graph.facebook.com/vX.X/{page-id}/acknowledge_orders?access_token={PAGE_ACCESS_TOKEN}

Request

AttributeTypeRequiredDescription

orders

array of order_id

Required

Array of 100 or less order IDs.

idempotency_key

string

Required

A unique key per request

order_id object

AttributeTypeRequiredDescription

id

string

Required

ID of the order.

merchant_order_reference

string

Optional

ID representing the order in

your order management system

You can Acknowledge multiple orders in one request. If few orders were in FB_PROCESSING state, then you cannot ACK them and receive a coded exception. Retrying these requests with same idempotency key returns the same result. When you get a coded exception, please use new idempotency key and retry.

Sample Request

{
  "idempotency_key": "cb090e84-e75a-9a34-45d3-5163bec88b65",
  "orders": [
    {
      "id": "64000841790004"
    },
    {
      "id": "10100677592885259"
    }
  ]
}

Response

AttributeTypeDescription

orders

array of order_id_and_state

order_id_and_state object

AttributeTypeDescription

id

string

ID of the order.

state

order_state

Sample Response

{
  "orders": [
    {
      "id": "64000841790004",
      "state": "IN_PROGRESS"
    },
    {
      "id": "10100677592885259",
      "error": {
        "error_code": 2361003,
        "error_message": "Invalid Order ID"
      }
    }
  ]
}