Transactions

The Payouts endpoint will give you the payout history for your store, but it contains limited details on those payouts. To get more detailed information for a particular payout, please refer to the Transactions endpoint.

Query this endpoint using the 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.

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. Sometime it might take few more days after you received the payout to get updates about it from our payment provider. Please give it 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

The 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

transaction_type, transaction_date, order_details, transfer_id, processing_fee, net_payment_amount, tax_rate, payout_reference_id

Returns specified fields

Response

AttributeTypeDescription

data

array of transaction_detail

Transaction details.

transaction_detail object

AttributeTypeDescription

transaction_type

string

Type of transaction. Allowed values are: 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.

payout_reference_id

string

The reference ID associated with this payout.

tax_details object

AttributeTypeDescription

data

array of tax_detail

tax_detail object

AttributeTypeDescription

tax_category

string

jurisdiction

string

imposition

string

item_tax_rate

string

item_tax_amount

currency_amount

currency_amount object

AttributeTypeDescription

amount

string

Amount in decimal format, eg. 4.99.

currency

string

Three digit ISO-4217-3 code for the purchase, e.g. USD.

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"
    }
  }
}