Skip to main content
POST
/
api-order
/
checkout-v4
Order checkout (v4)
curl --request POST \
  --url https://prod01-apigw.{customer_name}.fabric.zone/api-order/checkout-v4 \
  --header 'Content-Type: application/json' \
  --data '
{
  "cartId": "5e4876e10cfe1d8902005d33",
  "customerEmail": "jsmith@example.com",
  "estimatedTax": {
    "itemsTaxes": [
      {
        "lineItemId": 2,
        "amount": 20
      }
    ],
    "shipToTaxes": [
      {
        "shipToId": "5ec35a857e6cac8d99a57d3b",
        "amount": 20
      }
    ]
  },
  "customerAccountId": "5e3598e3007c5e00080d2bb8",
  "paymentDetails": [
    {
      "transactionDetails": {
        "paymentType": "CARD",
        "tokenizedPaymentMethod": "12fyg3fv4dbb56bbd7dfb890123456",
        "cardNumber": "1234567890123456",
        "expDate": "0220",
        "cvv": "123",
        "cardHolderFullName": "Mr John Smith",
        "metadata": {}
      },
      "paymentMethod": "Visa",
      "paymentKind": "<string>",
      "amount": 533.33,
      "currency": "USD",
      "billToAddress": {
        "name": {
          "first": "John",
          "last": "Smith",
          "middle": "Paul"
        },
        "email": "johnsmith@fabric.inc",
        "street1": "10400 NE 4th St",
        "city": "Bellevue",
        "state": "WA",
        "country": "USA",
        "zipCode": "98004",
        "street2": "Suite 500",
        "kind": "Bill to address"
      },
      "billToId": 1000001,
      "shipToId": [
        1000001,
        1000002
      ],
      "conversion": 1.12
    }
  ]
}
'
import requests

url = "https://prod01-apigw.{customer_name}.fabric.zone/api-order/checkout-v4"

payload = {
    "cartId": "5e4876e10cfe1d8902005d33",
    "customerEmail": "jsmith@example.com",
    "estimatedTax": {
        "itemsTaxes": [
            {
                "lineItemId": 2,
                "amount": 20
            }
        ],
        "shipToTaxes": [
            {
                "shipToId": "5ec35a857e6cac8d99a57d3b",
                "amount": 20
            }
        ]
    },
    "customerAccountId": "5e3598e3007c5e00080d2bb8",
    "paymentDetails": [
        {
            "transactionDetails": {
                "paymentType": "CARD",
                "tokenizedPaymentMethod": "12fyg3fv4dbb56bbd7dfb890123456",
                "cardNumber": "1234567890123456",
                "expDate": "0220",
                "cvv": "123",
                "cardHolderFullName": "Mr John Smith",
                "metadata": {}
            },
            "paymentMethod": "Visa",
            "paymentKind": "<string>",
            "amount": 533.33,
            "currency": "USD",
            "billToAddress": {
                "name": {
                    "first": "John",
                    "last": "Smith",
                    "middle": "Paul"
                },
                "email": "johnsmith@fabric.inc",
                "street1": "10400 NE 4th St",
                "city": "Bellevue",
                "state": "WA",
                "country": "USA",
                "zipCode": "98004",
                "street2": "Suite 500",
                "kind": "Bill to address"
            },
            "billToId": 1000001,
            "shipToId": [1000001, 1000002],
            "conversion": 1.12
        }
    ]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    cartId: '5e4876e10cfe1d8902005d33',
    customerEmail: 'jsmith@example.com',
    estimatedTax: {
      itemsTaxes: [{lineItemId: 2, amount: 20}],
      shipToTaxes: [{shipToId: '5ec35a857e6cac8d99a57d3b', amount: 20}]
    },
    customerAccountId: '5e3598e3007c5e00080d2bb8',
    paymentDetails: [
      {
        transactionDetails: {
          paymentType: 'CARD',
          tokenizedPaymentMethod: '12fyg3fv4dbb56bbd7dfb890123456',
          cardNumber: '1234567890123456',
          expDate: '0220',
          cvv: '123',
          cardHolderFullName: 'Mr John Smith',
          metadata: {}
        },
        paymentMethod: 'Visa',
        paymentKind: '<string>',
        amount: 533.33,
        currency: 'USD',
        billToAddress: {
          name: {first: 'John', last: 'Smith', middle: 'Paul'},
          email: 'johnsmith@fabric.inc',
          street1: '10400 NE 4th St',
          city: 'Bellevue',
          state: 'WA',
          country: 'USA',
          zipCode: '98004',
          street2: 'Suite 500',
          kind: 'Bill to address'
        },
        billToId: 1000001,
        shipToId: [1000001, 1000002],
        conversion: 1.12
      }
    ]
  })
};

fetch('https://prod01-apigw.{customer_name}.fabric.zone/api-order/checkout-v4', 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/checkout-v4",
  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([
    'cartId' => '5e4876e10cfe1d8902005d33',
    'customerEmail' => 'jsmith@example.com',
    'estimatedTax' => [
        'itemsTaxes' => [
                [
                                'lineItemId' => 2,
                                'amount' => 20
                ]
        ],
        'shipToTaxes' => [
                [
                                'shipToId' => '5ec35a857e6cac8d99a57d3b',
                                'amount' => 20
                ]
        ]
    ],
    'customerAccountId' => '5e3598e3007c5e00080d2bb8',
    'paymentDetails' => [
        [
                'transactionDetails' => [
                                'paymentType' => 'CARD',
                                'tokenizedPaymentMethod' => '12fyg3fv4dbb56bbd7dfb890123456',
                                'cardNumber' => '1234567890123456',
                                'expDate' => '0220',
                                'cvv' => '123',
                                'cardHolderFullName' => 'Mr John Smith',
                                'metadata' => [
                                                                
                                ]
                ],
                'paymentMethod' => 'Visa',
                'paymentKind' => '<string>',
                'amount' => 533.33,
                'currency' => 'USD',
                'billToAddress' => [
                                'name' => [
                                                                'first' => 'John',
                                                                'last' => 'Smith',
                                                                'middle' => 'Paul'
                                ],
                                'email' => 'johnsmith@fabric.inc',
                                'street1' => '10400 NE 4th St',
                                'city' => 'Bellevue',
                                'state' => 'WA',
                                'country' => 'USA',
                                'zipCode' => '98004',
                                'street2' => 'Suite 500',
                                'kind' => 'Bill to address'
                ],
                'billToId' => 1000001,
                'shipToId' => [
                                1000001,
                                1000002
                ],
                'conversion' => 1.12
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json"
  ],
]);

$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/checkout-v4"

	payload := strings.NewReader("{\n  \"cartId\": \"5e4876e10cfe1d8902005d33\",\n  \"customerEmail\": \"jsmith@example.com\",\n  \"estimatedTax\": {\n    \"itemsTaxes\": [\n      {\n        \"lineItemId\": 2,\n        \"amount\": 20\n      }\n    ],\n    \"shipToTaxes\": [\n      {\n        \"shipToId\": \"5ec35a857e6cac8d99a57d3b\",\n        \"amount\": 20\n      }\n    ]\n  },\n  \"customerAccountId\": \"5e3598e3007c5e00080d2bb8\",\n  \"paymentDetails\": [\n    {\n      \"transactionDetails\": {\n        \"paymentType\": \"CARD\",\n        \"tokenizedPaymentMethod\": \"12fyg3fv4dbb56bbd7dfb890123456\",\n        \"cardNumber\": \"1234567890123456\",\n        \"expDate\": \"0220\",\n        \"cvv\": \"123\",\n        \"cardHolderFullName\": \"Mr John Smith\",\n        \"metadata\": {}\n      },\n      \"paymentMethod\": \"Visa\",\n      \"paymentKind\": \"<string>\",\n      \"amount\": 533.33,\n      \"currency\": \"USD\",\n      \"billToAddress\": {\n        \"name\": {\n          \"first\": \"John\",\n          \"last\": \"Smith\",\n          \"middle\": \"Paul\"\n        },\n        \"email\": \"johnsmith@fabric.inc\",\n        \"street1\": \"10400 NE 4th St\",\n        \"city\": \"Bellevue\",\n        \"state\": \"WA\",\n        \"country\": \"USA\",\n        \"zipCode\": \"98004\",\n        \"street2\": \"Suite 500\",\n        \"kind\": \"Bill to address\"\n      },\n      \"billToId\": 1000001,\n      \"shipToId\": [\n        1000001,\n        1000002\n      ],\n      \"conversion\": 1.12\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	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/checkout-v4")
  .header("Content-Type", "application/json")
  .body("{\n  \"cartId\": \"5e4876e10cfe1d8902005d33\",\n  \"customerEmail\": \"jsmith@example.com\",\n  \"estimatedTax\": {\n    \"itemsTaxes\": [\n      {\n        \"lineItemId\": 2,\n        \"amount\": 20\n      }\n    ],\n    \"shipToTaxes\": [\n      {\n        \"shipToId\": \"5ec35a857e6cac8d99a57d3b\",\n        \"amount\": 20\n      }\n    ]\n  },\n  \"customerAccountId\": \"5e3598e3007c5e00080d2bb8\",\n  \"paymentDetails\": [\n    {\n      \"transactionDetails\": {\n        \"paymentType\": \"CARD\",\n        \"tokenizedPaymentMethod\": \"12fyg3fv4dbb56bbd7dfb890123456\",\n        \"cardNumber\": \"1234567890123456\",\n        \"expDate\": \"0220\",\n        \"cvv\": \"123\",\n        \"cardHolderFullName\": \"Mr John Smith\",\n        \"metadata\": {}\n      },\n      \"paymentMethod\": \"Visa\",\n      \"paymentKind\": \"<string>\",\n      \"amount\": 533.33,\n      \"currency\": \"USD\",\n      \"billToAddress\": {\n        \"name\": {\n          \"first\": \"John\",\n          \"last\": \"Smith\",\n          \"middle\": \"Paul\"\n        },\n        \"email\": \"johnsmith@fabric.inc\",\n        \"street1\": \"10400 NE 4th St\",\n        \"city\": \"Bellevue\",\n        \"state\": \"WA\",\n        \"country\": \"USA\",\n        \"zipCode\": \"98004\",\n        \"street2\": \"Suite 500\",\n        \"kind\": \"Bill to address\"\n      },\n      \"billToId\": 1000001,\n      \"shipToId\": [\n        1000001,\n        1000002\n      ],\n      \"conversion\": 1.12\n    }\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://prod01-apigw.{customer_name}.fabric.zone/api-order/checkout-v4")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cartId\": \"5e4876e10cfe1d8902005d33\",\n  \"customerEmail\": \"jsmith@example.com\",\n  \"estimatedTax\": {\n    \"itemsTaxes\": [\n      {\n        \"lineItemId\": 2,\n        \"amount\": 20\n      }\n    ],\n    \"shipToTaxes\": [\n      {\n        \"shipToId\": \"5ec35a857e6cac8d99a57d3b\",\n        \"amount\": 20\n      }\n    ]\n  },\n  \"customerAccountId\": \"5e3598e3007c5e00080d2bb8\",\n  \"paymentDetails\": [\n    {\n      \"transactionDetails\": {\n        \"paymentType\": \"CARD\",\n        \"tokenizedPaymentMethod\": \"12fyg3fv4dbb56bbd7dfb890123456\",\n        \"cardNumber\": \"1234567890123456\",\n        \"expDate\": \"0220\",\n        \"cvv\": \"123\",\n        \"cardHolderFullName\": \"Mr John Smith\",\n        \"metadata\": {}\n      },\n      \"paymentMethod\": \"Visa\",\n      \"paymentKind\": \"<string>\",\n      \"amount\": 533.33,\n      \"currency\": \"USD\",\n      \"billToAddress\": {\n        \"name\": {\n          \"first\": \"John\",\n          \"last\": \"Smith\",\n          \"middle\": \"Paul\"\n        },\n        \"email\": \"johnsmith@fabric.inc\",\n        \"street1\": \"10400 NE 4th St\",\n        \"city\": \"Bellevue\",\n        \"state\": \"WA\",\n        \"country\": \"USA\",\n        \"zipCode\": \"98004\",\n        \"street2\": \"Suite 500\",\n        \"kind\": \"Bill to address\"\n      },\n      \"billToId\": 1000001,\n      \"shipToId\": [\n        1000001,\n        1000002\n      ],\n      \"conversion\": 1.12\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
{
  "checkoutComplete": true,
  "pointOfFailure": "payment",
  "paymentResp": {
    "totalAmountCapturable": 100,
    "orderTotal": 1001
  }
}
{
  "code": "<string>",
  "message": "<string>"
}
{
  "code": "CART_NOT_FOUND",
  "message": "Cart not found."
}
{
  "code": "<string>",
  "message": "<string>"
}

Headers

x-api-key
string
Example:

"0LybWR49k95cCwYh3cu0waCYoh4H2Eux2J52wn4k"

Body

application/json
cartId
string
required
Required string length: 24
Example:

"5e4876e10cfe1d8902005d33"

customerEmail
string<email>
required
Minimum string length: 3
estimatedTax
object
required
customerAccountId
string
Minimum string length: 3
Example:

"5e3598e3007c5e00080d2bb8"

customerPhoneNumber
object
paymentDetails
object[]
shipFrom
object

Response

Order checkout

checkoutComplete
boolean
pointOfFailure
string
Example:

"payment"

paymentResp
object