Transactions

As a seller, you can use the Payouts endpoint to access the payout history for your store (with limited details about those payouts). To access more detailed information about a specific payout, see the Transactions endpoint.

Query the Payouts endpoint using payout_reference_id to obtain information, such as which orders were included in a given payout, whether the payout was a sale or a refund, and tax details. See also GPT to Facebook Tax Category Mappings.

Below is an example request to get all transactions and their order details for the month of June.

We recommend to pull transactions few days before the payout date and until the payout date. For the July example, pull orders from middle of June until end of July. It might take a few more days after you received the payout to get updates from our payment provider. Allow up to 3 business days.

Graph API Explorer
curl -X GET -G \
  -d 'payout_reference_id="FBMP123123"' \
  -d 'start_time=1557878400' \
  -d 'end_time=1598867200' \
  -d 'fields="transaction_type,transaction_date,order_details,transfer_id,processing_fee,net_payment_amount,tax_rate,payout_reference_id"' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/{page-id}/commerce_transactions
GET /{page-id}/commerce_transactions?payout_reference_id=FBMP123123&start_time=1557878400&end_time=1598867200&fields=transaction_type%2Ctransaction_date%2Corder_details%2Ctransfer_id%2Cprocessing_fee%2Cnet_payment_amount%2Ctax_rate%2Cpayout_reference_id HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{page-id}/commerce_transactions?payout_reference_id=FBMP123123&start_time=1557878400&end_time=1598867200&fields=transaction_type%2Ctransaction_date%2Corder_details%2Ctransfer_id%2Cprocessing_fee%2Cnet_payment_amount%2Ctax_rate%2Cpayout_reference_id',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{page-id}/commerce_transactions",
    {
        "payout_reference_id": "FBMP123123",
        "start_time": 1557878400,
        "end_time": 1598867200,
        "fields": "transaction_type,transaction_date,order_details,transfer_id,processing_fee,net_payment_amount,tax_rate,payout_reference_id"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);

Request

AttributeTypeDescription

payout_reference_id

string

Reference ID associated with a payout.

start_time

Unix Timestamp

Starting time period for orders returned.

end_time

Unix Timestamp

Ending time period for orders returned.

fields

Returns specified fields:

transaction_type, transaction_date, order_details, transfer_id, processing_fee, net_payment_amount, tax_rate, payout_reference_id. See transaction_detail for details.

Response

AttributeTypeDescription

data

array of transaction_detail

Transaction details.

transaction_detail object

AttributeTypeDescription

items

array of order_items

Array of order_items.

transaction_type

string

Type of transaction. Supported values: SALE or REFUND.

transaction_date

string

Order last update time in ISO 8601 format.

order_details

Order object

Details about this order.

transfer_id

string

The ID of the transfer.

processing_fee

currency_amount

Processing fee.

net_payment_amount

currency_amount

Net payment amount.

tax_rate

string

Percentage tax rate.

tax_details

array of tax_details

Tax details. See also GPT to Facebook Tax Category Mappings.

payout_reference_id

string

The reference ID associated with this payout.

order_items object

AttributeTypeDescription

order_items

array

Array of order items that includes the following fields:

tax_details object

AttributeTypeDescription

data

array of tax_detail

See item_tax_details and GPT to Facebook Tax Category Mappings.

tax_detail object

AttributeTypeDescription

tax_category

string

Facebook tax category. See also GPT to Facebook Tax Category Mappings.

jurisdiction

string

Jurisdiction for this tax item; for example, estate, city, finance authority, and so on.

imposition

string

Imposed tax; for example: Sales and Use Tax.

item_tax_rate

string

Tax rate for item. See also GPT to Facebook Tax Category Mappings.

item_tax_amount

currency_amount

Tax amount for item. See also GPT to Facebook Tax Category Mappings.

currency_amount object

AttributeTypeDescription

amount

string

Amount in decimal format. Example: 4.99

currency

string

Three digit ISO-4217-3 code for the purchase. Format the currency as a number, followed by the 3-digit ISO currency code (ISO 4217 standards), with a space between cost and currency. Example: USD

selected_shipping_option object

AttributeTypeDescription

name

string

Human readable name of the shipping option.

price

currency_amount

Shipping cost.

calculated_tax

currency_amount

Shipping tax amount. This amount is updated as the order is fulfilled, you can do additional API calls to update this amount.

estimated_shipping_time

estimated_shipping_time

Estimated shipping time

Sample Response

{
  "data": [
    {
      "transaction_type": "REFUND",
      "transaction_date": "2019-09-06T19:56:53+00:00",
      "order_details": {
        "id": "420069168636230",
        "order_status": {
          "state": "COMPLETED"
        },
        "created": "2019-08-27T21:08:42+00:00",
        "last_updated": "2019-09-06T19:56:56+00:00"
      },
      "processing_fee": {
        "amount": "0.00",
        "currency": "USD"
      },
      "net_payment_amount": {
        "amount": "-0.40",
        "currency": "USD"
      },
      "tax_rate": "0%;0%"
    },
    {
      "transaction_type": "REFUND",
      "transaction_date": "2019-09-06T19:56:53+00:00",
      "order_details": {
        "id": "420069168636230",
        "order_status": {
          "state": "COMPLETED"
        },
        "created": "2019-08-27T21:08:42+00:00",
        "last_updated": "2019-09-06T19:56:56+00:00"
      },
      "processing_fee": {
        "amount": "0.00",
        "currency": "USD"
      },
      "net_payment_amount": {
        "amount": "-0.11",
        "currency": "USD"
      },
      "tax_rate": "0%;0%"
    },
  ],
  "paging": {
    "cursors": {
      "before": "MAZDZD",
      "after": "MTgZD"
    }
  }
}