Return payment by orderId
curl --request POST \
--url https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '
{
"orders": [
"4809-7758-87594"
]
}
'import requests
url = "https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment"
payload = { "orders": ["4809-7758-87594"] }
headers = {
"x-site-context": "<x-site-context>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-site-context': '<x-site-context>', 'Content-Type': 'application/json'},
body: JSON.stringify({orders: ['4809-7758-87594']})
};
fetch('https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'orders' => [
'4809-7758-87594'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-site-context: <x-site-context>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment"
payload := strings.NewReader("{\n \"orders\": [\n \"4809-7758-87594\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-site-context", "<x-site-context>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment")
.header("x-site-context", "<x-site-context>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n \"4809-7758-87594\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-site-context"] = '<x-site-context>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orders\": [\n \"4809-7758-87594\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"query": {
"limit": 10,
"offset": 0,
"count": 2
},
"orders": [
{
"_id": "61160edde8af410009827c28",
"isSugarRefunded": true,
"tags": "<array>",
"cartId": "61160ddbffac450008316d70",
"attributes": "<array>",
"customerEmail": "mike@fabric.inc",
"orderCurrency": "USD",
"orderTotal": 6011.99,
"taxTotal": 0,
"channel": 12,
"status": "ORDER_CREATED",
"statusLog": "Order has been created",
"orderReference": "3635-1613-42753",
"orderId": "4809-7758-87594",
"shipTo": [
{
"address": {
"name": {
"first": "First",
"last": "Last"
},
"phone": {
"number": "123-992-9404",
"kind": "Mobile"
},
"street1": "888 Broadway",
"city": "New York",
"state": "NY",
"country": "United States",
"zipCode": 10003,
"kind": "shipping",
"email": "first@fabric.inc"
},
"delivery": {
"actual": "<string>"
},
"shipping": {
"actual": "<string>"
},
"promosApplied": "<array>",
"_id": "61160dea8e37e00008266191",
"shipToType": "SHIP_TO_ADDRESS",
"taxCode": "FR1000",
"shipToId": 1499,
"price": 11.99,
"shipmentMethodId": 10002,
"estimatedTax": 0,
"shipmentCarrier": "2 Day",
"total": 11.99,
"readyForPickups": "<array>",
"id": "61160dea8e37e00008266191"
}
],
"items": [
{
"group": [
1.2312312312312322e+23
],
"promosApplied": "<array>",
"_id": "61160ddbffac450008316d71",
"price": 600,
"weightUnit": "kg",
"isPickup": true,
"itemId": 1000011164,
"quantity": 10,
"priceListId": 100000,
"sku": "BLUETEST",
"taxCode": "PH060771",
"title": "Loki Cat",
"weight": 7,
"lineItemId": 1,
"attributeTotalPrice": 0,
"attributes": "<array>",
"currency": "USD",
"shipToId": 1499,
"discount": 0,
"estimatedTax": 0,
"total": 6000,
"reservedLocation": "<array>",
"id": "61160ddbffac450008316d71"
}
],
"shipments": "<array>",
"payments": [
{
"billToAddress": {
"name": {
"first": "John",
"last": "Smith"
},
"phone": {
"number": 7780811973,
"kind": "mobile"
},
"email": "johnsmith@gmail.com",
"street1": "600 Congress Ave",
"street2": "suite 219",
"city": "Austin",
"state": "Tx",
"country": "US",
"zipCode": 10033
},
"shipToId": [
1499
],
"_id": "61160edde8af410009827c2b",
"paymentStatus": "authorized",
"amount": 5000,
"currency": "USD",
"paymentIdentifier": {
"cardIdentifier": 4242
},
"paymentMethod": "visa",
"paymentKind": "CARD_STRIPE",
"conversion": 1,
"paymentToken": {
"token": "pi_3JNthOJxr7zyIFb91Tp0jQTG",
"type": "CARD_STRIPE"
},
"id": "61160edde8af410009827c2b"
}
],
"revision": 0,
"totalQuantity": 10,
"statusDescriptions": "<array>",
"events": "<array>",
"pickups": "<array>",
"createdAt": "2021-08-13T06:19:09.589Z",
"updatedAt": "2021-08-13T06:19:09.589Z",
"__v": 0
}
]
}{
"code": "<string>",
"message": "<string>"
}{
"message": "Forbidden"
}{
"code": "<string>",
"message": "<string>"
}Order
Return payment by orderId
Return payment by orderId
POST
/
api-order
/
orders
/
payment
Return payment by orderId
curl --request POST \
--url https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '
{
"orders": [
"4809-7758-87594"
]
}
'import requests
url = "https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment"
payload = { "orders": ["4809-7758-87594"] }
headers = {
"x-site-context": "<x-site-context>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-site-context': '<x-site-context>', 'Content-Type': 'application/json'},
body: JSON.stringify({orders: ['4809-7758-87594']})
};
fetch('https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'orders' => [
'4809-7758-87594'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-site-context: <x-site-context>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment"
payload := strings.NewReader("{\n \"orders\": [\n \"4809-7758-87594\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-site-context", "<x-site-context>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment")
.header("x-site-context", "<x-site-context>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n \"4809-7758-87594\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod01-apigw.{customer_name}.fabric.zone/api-order/orders/payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-site-context"] = '<x-site-context>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orders\": [\n \"4809-7758-87594\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"query": {
"limit": 10,
"offset": 0,
"count": 2
},
"orders": [
{
"_id": "61160edde8af410009827c28",
"isSugarRefunded": true,
"tags": "<array>",
"cartId": "61160ddbffac450008316d70",
"attributes": "<array>",
"customerEmail": "mike@fabric.inc",
"orderCurrency": "USD",
"orderTotal": 6011.99,
"taxTotal": 0,
"channel": 12,
"status": "ORDER_CREATED",
"statusLog": "Order has been created",
"orderReference": "3635-1613-42753",
"orderId": "4809-7758-87594",
"shipTo": [
{
"address": {
"name": {
"first": "First",
"last": "Last"
},
"phone": {
"number": "123-992-9404",
"kind": "Mobile"
},
"street1": "888 Broadway",
"city": "New York",
"state": "NY",
"country": "United States",
"zipCode": 10003,
"kind": "shipping",
"email": "first@fabric.inc"
},
"delivery": {
"actual": "<string>"
},
"shipping": {
"actual": "<string>"
},
"promosApplied": "<array>",
"_id": "61160dea8e37e00008266191",
"shipToType": "SHIP_TO_ADDRESS",
"taxCode": "FR1000",
"shipToId": 1499,
"price": 11.99,
"shipmentMethodId": 10002,
"estimatedTax": 0,
"shipmentCarrier": "2 Day",
"total": 11.99,
"readyForPickups": "<array>",
"id": "61160dea8e37e00008266191"
}
],
"items": [
{
"group": [
1.2312312312312322e+23
],
"promosApplied": "<array>",
"_id": "61160ddbffac450008316d71",
"price": 600,
"weightUnit": "kg",
"isPickup": true,
"itemId": 1000011164,
"quantity": 10,
"priceListId": 100000,
"sku": "BLUETEST",
"taxCode": "PH060771",
"title": "Loki Cat",
"weight": 7,
"lineItemId": 1,
"attributeTotalPrice": 0,
"attributes": "<array>",
"currency": "USD",
"shipToId": 1499,
"discount": 0,
"estimatedTax": 0,
"total": 6000,
"reservedLocation": "<array>",
"id": "61160ddbffac450008316d71"
}
],
"shipments": "<array>",
"payments": [
{
"billToAddress": {
"name": {
"first": "John",
"last": "Smith"
},
"phone": {
"number": 7780811973,
"kind": "mobile"
},
"email": "johnsmith@gmail.com",
"street1": "600 Congress Ave",
"street2": "suite 219",
"city": "Austin",
"state": "Tx",
"country": "US",
"zipCode": 10033
},
"shipToId": [
1499
],
"_id": "61160edde8af410009827c2b",
"paymentStatus": "authorized",
"amount": 5000,
"currency": "USD",
"paymentIdentifier": {
"cardIdentifier": 4242
},
"paymentMethod": "visa",
"paymentKind": "CARD_STRIPE",
"conversion": 1,
"paymentToken": {
"token": "pi_3JNthOJxr7zyIFb91Tp0jQTG",
"type": "CARD_STRIPE"
},
"id": "61160edde8af410009827c2b"
}
],
"revision": 0,
"totalQuantity": 10,
"statusDescriptions": "<array>",
"events": "<array>",
"pickups": "<array>",
"createdAt": "2021-08-13T06:19:09.589Z",
"updatedAt": "2021-08-13T06:19:09.589Z",
"__v": 0
}
]
}{
"code": "<string>",
"message": "<string>"
}{
"message": "Forbidden"
}{
"code": "<string>",
"message": "<string>"
}Headers
Example:
"0LybWR49k95cCwYh3cu0waCYoh4H2Eux2J52wn4k"
The x-site-context header is a JSON object that contains information about the source you wish to pull from. The mandatory account is the 24 character identifier found in Copilot. The channel (Sales channel ID), stage (environment name), and date attributes can be used to further narrow the scope of your data source.
Example:
"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"
Query Parameters
Show child attributes
Show child attributes
Body
application/json
Was this page helpful?
⌘I
