These endpoints can be used to obtain additional financial details for a specific order:
An order can have multiple shipments. Currently each shipment will correspond to one payment. In future we may have one payment for multiple shipments.
Fetch all payment details for a given order.
curl -X GET -G \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/{order-id}/payments
GET /{order-id}/payments 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(
'/{order-id}/payments',
'{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(
"/{order-id}/payments",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Attribute | Type | Description |
---|---|---|
|
| Returns specified fields |
Attribute | Type | Description |
---|---|---|
| array of |
payment_details
objectAttribute | Type | Description |
---|---|---|
| array of |
payment_info
objectAttribute | Type | Description |
---|---|---|
|
| ID of the payment for the order |
| Subtotal amounts on the order | |
| Tax amount charged on the order | |
|
|
|
| Total amount charged in this payment | |
| Shipment associated with this payment | |
| Optional. Details of successful transactions associated with this payment. This field is missing in the case of failed payment capture, and orders without this field cannot be refunded. |
subtotal
objectAttribute | Type | Description |
---|---|---|
| Amount of the item associated with this payment. | |
| We prorate shipping based on the shipping profile. Let’s say seller ships 1 item, then the 2nd item. Example 1 - shipping is $5 base cost, then $1 per additional item. We will charge $5 shipping on first shipment, $1 on second shipment Example 2 - shipping is $6 flat cost. We will charge $6 shipping on first shipment, $0 on second shipment |
shipments
objectAttribute | Type | Description |
---|---|---|
| array of | Each shipment will correspond to one payment so today this is an array with one element only. In future we may add multiple shipments to one payment. |
shipment_info
objectAttribute | Type | Description |
---|---|---|
|
| Facebook shipment ID |
|
| ID representing the shipment in your database. This ID can be used to perform updates on tracking info set on a shipment. Optional but recommended. |
transaction_details
objectAttribute | Type | Description |
---|---|---|
| array of |
transaction_detail
objectAttribute | Type | Description |
---|---|---|
|
| Type of transaction. Allowed values are: |
|
| Order's latest update datetime in ISO 8601 format. |
|
| |
| Processing fee | |
| Net payment amount | |
|
| Percentage tax rate |
| array of | Tax details object |
| string | The bank reference ID associated with the payout in which this transaction is included. Note: only available for payouts processed after 5/15/19. |
tax_details
objectAttribute | Type | Description |
---|---|---|
| array of |
tax_detail
objectAttribute | Type | Description |
---|---|---|
|
| |
|
| |
|
| |
|
| |
|
currency_amount
objectAttribute | Type | Description |
---|---|---|
|
| Amount in decimal format, eg. "5.5". |
|
| Three digit ISO-4217-3 code for the purchase, e.g. USD. |
{ "data": [ { "id": "2381232183", "subtotal": { "items": { "amount": "40.00", "currency": "USD" }, "shipping": { "amount": "0.00", "currency": "USD" } }, "tax": { "amount": "0.06", "currency": "USD" }, "tax_remitted": true, "total_amount": { "amount": "44.06", "currency": "USD" }, "shipments": { "data": [ { "id": "2121312213", "external_shipment_id": "shopify-shipment-1" }, { "id": "2121312213", "external_shipment_id": "shopify-shipment-2" } ] }, "transaction_details": { "data": [ { "transaction_type": "SALE", "transaction_date": "2019-01-03T09:16:21+00:00", "transfer_id": "po_1DqSkwFN7vzsfPbcs4aFsknN", "processing_fee": { "amount": "-0.33", "currency": "USD" }, "net_payment_amount": { "amount": "0.67", "currency": "USD" } }, { "transaction_type": "REFUND", "transaction_date": "2019-01-09T06:18:50+00:00", "processing_fee": { "amount": "0.33", "currency": "USD" }, "net_payment_amount": { "amount": "-0.67", "currency": "USD" }, "tax_rate": "8.25%", "tax_details": { "data": [ { "tax_category": "FBMP_OTHER_TAXABLE", "jurisdiction": "CALIFORNIA", "imposition": "Sales and Use Tax", "item_tax_rate": "6%", "item_tax_amount": { "amount": "0.06", "currency": "USD" } }, { "tax_category": "FBMP_OTHER_TAXABLE", "jurisdiction": "ALAMEDA", "imposition": "Local Sales and Use Tax", "item_tax_rate": "1.25%", "item_tax_amount": { "amount": "0.01", "currency": "USD" } }, // and more ] } } ] } } ], "paging": { "cursors": { "before": "--sanitized_key--", "after": "--sanitized_key--" } } }
Get details of all promotions applied on an order. Example: reimbursements.
Reimbursement payout id details are not yet available. Use the Commerce Manager reimbursement report to pull information about reimbursements.
curl -X GET -G \
-d 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/{order-id}/promotions
GET /{order-id}/promotions 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(
'/{order-id}/promotions',
'{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(
"/{order-id}/promotions",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Attribute | Type | Description |
---|---|---|
|
| Returns specified fields |
Attribute | Type | Description |
---|---|---|
| array of |
promotion_details
objectAttribute | Type | Description |
---|---|---|
|
| ID of the promotion |
|
| Name of the promotion |
| array of | Reimbursement details for the promotion |
reimbursement_details
objectAttribute | Type | Description |
---|---|---|
| Net payout |
{ "data": [ { "id": "2131312312", "name": "FIRST_TIME_BUYER", "reimbursement": { "net_payout": { "amount": "10.00", "currency": "USD" } } } ], "paging": { "cursors": { "before": "--sanitized_key--", "after": "--sanitized_key--" } } }