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.
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 */
}
}
);
Attribute | Type | Description |
---|---|---|
|
| Reference ID associated with a payout. |
| Starting time period for orders returned. | |
| Ending time period for orders returned. | |
| Returns specified fields:
|
Attribute | Type | Description |
---|---|---|
|
| Transaction details. |
transaction_detail
objectAttribute | Type | Description |
---|---|---|
| array of | Array of |
|
| Type of transaction. Supported values: |
|
| Order last update time in ISO 8601 format. |
|
| Details about this order. |
|
| The ID of the transfer. |
| Processing fee. | |
| Net payment amount. | |
|
| Percentage tax rate. |
| array of | Tax details. See also GPT to Facebook Tax Category Mappings. |
|
| The reference ID associated with this payout. |
order_items
objectAttribute | Type | Description |
---|---|---|
| array | Array of order items that includes the following fields:
|
tax_details
objectAttribute | Type | Description |
---|---|---|
| array of | See |
tax_detail
objectAttribute | Type | Description |
---|---|---|
|
| Facebook tax category. See also GPT to Facebook Tax Category Mappings. |
|
| Jurisdiction for this tax item; for example, estate, city, finance authority, and so on. |
|
| Imposed tax; for example: Sales and Use Tax. |
|
| Tax rate for item. See also GPT to Facebook Tax Category Mappings. |
| Tax amount for item. See also GPT to Facebook Tax Category Mappings. |
currency_amount
objectAttribute | Type | Description |
---|---|---|
|
| Amount in decimal format. Example: |
|
| 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: |
selected_shipping_option
objectAttribute | Type | Description |
---|---|---|
|
| Human readable name of the shipping option. |
| Shipping cost. | |
| 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 |
{ "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" } } }