Sale
curl --request POST \
--url https://api.example.com/v1/transactions/sale \
--header 'Content-Type: application/json' \
--data '
{
"payment": {
"token": "<string>",
"stored": {
"customer": "<string>",
"wallet": "<string>",
"installment": 123,
"initial_transaction_id": "<string>"
},
"cash": true,
"credit_card_encrypted": "<string>",
"google_pay_payment": {
"signature": "<string>",
"intermediate_signing_key": {
"signed_key": "<string>",
"signatures": [
"<string>"
]
},
"protocol_version": "<string>",
"signed_message": "<string>",
"postal_code": "<string>",
"name_on_card": "<string>"
},
"apple_pay_payment": {
"payment_data": {
"data": "<string>",
"signature": "<string>",
"header": {
"ephemeral_public_key": "<string>",
"public_key_hash": "<string>",
"transaction_id": "<string>"
},
"version": "<string>"
},
"payment_method": {
"display_name": "<string>",
"network": "<string>",
"type": "<string>"
},
"transaction_identifier": "<string>",
"name_on_card": "<string>",
"postal_code": "<string>"
}
},
"amount": {
"value": 500000000
},
"order": {
"customer_public_identifier": "<string>",
"reference_object": "<string>",
"reference_object_id": 123,
"bill_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"ship_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"discount": 123,
"surcharge": 123,
"shipping": 123,
"email": "<string>",
"tip": 123,
"tax": 123,
"total": 123,
"date": "2023-11-07T05:31:56Z",
"lines": [
{
"product_code": "<string>",
"description": "<string>",
"commodity_code": "<string>",
"unit_of_measure": "<string>",
"unit_cost": 123,
"quantity": 123,
"total": 123,
"tax": 123,
"tax_rate": 123,
"discount": 123,
"discount_rate": 123,
"tax_type": "<string>",
"alternate_tax_id": "<string>"
}
],
"metadata": {}
},
"initiated_by_user_id": 123,
"reference_transaction_id": 123,
"customer_subscription_id": 123
}
'import requests
url = "https://api.example.com/v1/transactions/sale"
payload = {
"payment": {
"token": "<string>",
"stored": {
"customer": "<string>",
"wallet": "<string>",
"installment": 123,
"initial_transaction_id": "<string>"
},
"cash": True,
"credit_card_encrypted": "<string>",
"google_pay_payment": {
"signature": "<string>",
"intermediate_signing_key": {
"signed_key": "<string>",
"signatures": ["<string>"]
},
"protocol_version": "<string>",
"signed_message": "<string>",
"postal_code": "<string>",
"name_on_card": "<string>"
},
"apple_pay_payment": {
"payment_data": {
"data": "<string>",
"signature": "<string>",
"header": {
"ephemeral_public_key": "<string>",
"public_key_hash": "<string>",
"transaction_id": "<string>"
},
"version": "<string>"
},
"payment_method": {
"display_name": "<string>",
"network": "<string>",
"type": "<string>"
},
"transaction_identifier": "<string>",
"name_on_card": "<string>",
"postal_code": "<string>"
}
},
"amount": { "value": 500000000 },
"order": {
"customer_public_identifier": "<string>",
"reference_object": "<string>",
"reference_object_id": 123,
"bill_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"ship_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"discount": 123,
"surcharge": 123,
"shipping": 123,
"email": "<string>",
"tip": 123,
"tax": 123,
"total": 123,
"date": "2023-11-07T05:31:56Z",
"lines": [
{
"product_code": "<string>",
"description": "<string>",
"commodity_code": "<string>",
"unit_of_measure": "<string>",
"unit_cost": 123,
"quantity": 123,
"total": 123,
"tax": 123,
"tax_rate": 123,
"discount": 123,
"discount_rate": 123,
"tax_type": "<string>",
"alternate_tax_id": "<string>"
}
],
"metadata": {}
},
"initiated_by_user_id": 123,
"reference_transaction_id": 123,
"customer_subscription_id": 123
}
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({
payment: {
token: '<string>',
stored: {
customer: '<string>',
wallet: '<string>',
installment: 123,
initial_transaction_id: '<string>'
},
cash: true,
credit_card_encrypted: '<string>',
google_pay_payment: {
signature: '<string>',
intermediate_signing_key: {signed_key: '<string>', signatures: ['<string>']},
protocol_version: '<string>',
signed_message: '<string>',
postal_code: '<string>',
name_on_card: '<string>'
},
apple_pay_payment: {
payment_data: {
data: '<string>',
signature: '<string>',
header: {
ephemeral_public_key: '<string>',
public_key_hash: '<string>',
transaction_id: '<string>'
},
version: '<string>'
},
payment_method: {display_name: '<string>', network: '<string>', type: '<string>'},
transaction_identifier: '<string>',
name_on_card: '<string>',
postal_code: '<string>'
}
},
amount: {value: 500000000},
order: {
customer_public_identifier: '<string>',
reference_object: '<string>',
reference_object_id: 123,
bill_to: {
name: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>'
},
ship_to: {
name: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>'
},
discount: 123,
surcharge: 123,
shipping: 123,
email: '<string>',
tip: 123,
tax: 123,
total: 123,
date: '2023-11-07T05:31:56Z',
lines: [
{
product_code: '<string>',
description: '<string>',
commodity_code: '<string>',
unit_of_measure: '<string>',
unit_cost: 123,
quantity: 123,
total: 123,
tax: 123,
tax_rate: 123,
discount: 123,
discount_rate: 123,
tax_type: '<string>',
alternate_tax_id: '<string>'
}
],
metadata: {}
},
initiated_by_user_id: 123,
reference_transaction_id: 123,
customer_subscription_id: 123
})
};
fetch('https://api.example.com/v1/transactions/sale', 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://api.example.com/v1/transactions/sale",
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([
'payment' => [
'token' => '<string>',
'stored' => [
'customer' => '<string>',
'wallet' => '<string>',
'installment' => 123,
'initial_transaction_id' => '<string>'
],
'cash' => true,
'credit_card_encrypted' => '<string>',
'google_pay_payment' => [
'signature' => '<string>',
'intermediate_signing_key' => [
'signed_key' => '<string>',
'signatures' => [
'<string>'
]
],
'protocol_version' => '<string>',
'signed_message' => '<string>',
'postal_code' => '<string>',
'name_on_card' => '<string>'
],
'apple_pay_payment' => [
'payment_data' => [
'data' => '<string>',
'signature' => '<string>',
'header' => [
'ephemeral_public_key' => '<string>',
'public_key_hash' => '<string>',
'transaction_id' => '<string>'
],
'version' => '<string>'
],
'payment_method' => [
'display_name' => '<string>',
'network' => '<string>',
'type' => '<string>'
],
'transaction_identifier' => '<string>',
'name_on_card' => '<string>',
'postal_code' => '<string>'
]
],
'amount' => [
'value' => 500000000
],
'order' => [
'customer_public_identifier' => '<string>',
'reference_object' => '<string>',
'reference_object_id' => 123,
'bill_to' => [
'name' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<string>'
],
'ship_to' => [
'name' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<string>'
],
'discount' => 123,
'surcharge' => 123,
'shipping' => 123,
'email' => '<string>',
'tip' => 123,
'tax' => 123,
'total' => 123,
'date' => '2023-11-07T05:31:56Z',
'lines' => [
[
'product_code' => '<string>',
'description' => '<string>',
'commodity_code' => '<string>',
'unit_of_measure' => '<string>',
'unit_cost' => 123,
'quantity' => 123,
'total' => 123,
'tax' => 123,
'tax_rate' => 123,
'discount' => 123,
'discount_rate' => 123,
'tax_type' => '<string>',
'alternate_tax_id' => '<string>'
]
],
'metadata' => [
]
],
'initiated_by_user_id' => 123,
'reference_transaction_id' => 123,
'customer_subscription_id' => 123
]),
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://api.example.com/v1/transactions/sale"
payload := strings.NewReader("{\n \"payment\": {\n \"token\": \"<string>\",\n \"stored\": {\n \"customer\": \"<string>\",\n \"wallet\": \"<string>\",\n \"installment\": 123,\n \"initial_transaction_id\": \"<string>\"\n },\n \"cash\": true,\n \"credit_card_encrypted\": \"<string>\",\n \"google_pay_payment\": {\n \"signature\": \"<string>\",\n \"intermediate_signing_key\": {\n \"signed_key\": \"<string>\",\n \"signatures\": [\n \"<string>\"\n ]\n },\n \"protocol_version\": \"<string>\",\n \"signed_message\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"name_on_card\": \"<string>\"\n },\n \"apple_pay_payment\": {\n \"payment_data\": {\n \"data\": \"<string>\",\n \"signature\": \"<string>\",\n \"header\": {\n \"ephemeral_public_key\": \"<string>\",\n \"public_key_hash\": \"<string>\",\n \"transaction_id\": \"<string>\"\n },\n \"version\": \"<string>\"\n },\n \"payment_method\": {\n \"display_name\": \"<string>\",\n \"network\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"transaction_identifier\": \"<string>\",\n \"name_on_card\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n },\n \"amount\": {\n \"value\": 500000000\n },\n \"order\": {\n \"customer_public_identifier\": \"<string>\",\n \"reference_object\": \"<string>\",\n \"reference_object_id\": 123,\n \"bill_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"ship_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"discount\": 123,\n \"surcharge\": 123,\n \"shipping\": 123,\n \"email\": \"<string>\",\n \"tip\": 123,\n \"tax\": 123,\n \"total\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"product_code\": \"<string>\",\n \"description\": \"<string>\",\n \"commodity_code\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"unit_cost\": 123,\n \"quantity\": 123,\n \"total\": 123,\n \"tax\": 123,\n \"tax_rate\": 123,\n \"discount\": 123,\n \"discount_rate\": 123,\n \"tax_type\": \"<string>\",\n \"alternate_tax_id\": \"<string>\"\n }\n ],\n \"metadata\": {}\n },\n \"initiated_by_user_id\": 123,\n \"reference_transaction_id\": 123,\n \"customer_subscription_id\": 123\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://api.example.com/v1/transactions/sale")
.header("Content-Type", "application/json")
.body("{\n \"payment\": {\n \"token\": \"<string>\",\n \"stored\": {\n \"customer\": \"<string>\",\n \"wallet\": \"<string>\",\n \"installment\": 123,\n \"initial_transaction_id\": \"<string>\"\n },\n \"cash\": true,\n \"credit_card_encrypted\": \"<string>\",\n \"google_pay_payment\": {\n \"signature\": \"<string>\",\n \"intermediate_signing_key\": {\n \"signed_key\": \"<string>\",\n \"signatures\": [\n \"<string>\"\n ]\n },\n \"protocol_version\": \"<string>\",\n \"signed_message\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"name_on_card\": \"<string>\"\n },\n \"apple_pay_payment\": {\n \"payment_data\": {\n \"data\": \"<string>\",\n \"signature\": \"<string>\",\n \"header\": {\n \"ephemeral_public_key\": \"<string>\",\n \"public_key_hash\": \"<string>\",\n \"transaction_id\": \"<string>\"\n },\n \"version\": \"<string>\"\n },\n \"payment_method\": {\n \"display_name\": \"<string>\",\n \"network\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"transaction_identifier\": \"<string>\",\n \"name_on_card\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n },\n \"amount\": {\n \"value\": 500000000\n },\n \"order\": {\n \"customer_public_identifier\": \"<string>\",\n \"reference_object\": \"<string>\",\n \"reference_object_id\": 123,\n \"bill_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"ship_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"discount\": 123,\n \"surcharge\": 123,\n \"shipping\": 123,\n \"email\": \"<string>\",\n \"tip\": 123,\n \"tax\": 123,\n \"total\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"product_code\": \"<string>\",\n \"description\": \"<string>\",\n \"commodity_code\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"unit_cost\": 123,\n \"quantity\": 123,\n \"total\": 123,\n \"tax\": 123,\n \"tax_rate\": 123,\n \"discount\": 123,\n \"discount_rate\": 123,\n \"tax_type\": \"<string>\",\n \"alternate_tax_id\": \"<string>\"\n }\n ],\n \"metadata\": {}\n },\n \"initiated_by_user_id\": 123,\n \"reference_transaction_id\": 123,\n \"customer_subscription_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/transactions/sale")
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 \"payment\": {\n \"token\": \"<string>\",\n \"stored\": {\n \"customer\": \"<string>\",\n \"wallet\": \"<string>\",\n \"installment\": 123,\n \"initial_transaction_id\": \"<string>\"\n },\n \"cash\": true,\n \"credit_card_encrypted\": \"<string>\",\n \"google_pay_payment\": {\n \"signature\": \"<string>\",\n \"intermediate_signing_key\": {\n \"signed_key\": \"<string>\",\n \"signatures\": [\n \"<string>\"\n ]\n },\n \"protocol_version\": \"<string>\",\n \"signed_message\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"name_on_card\": \"<string>\"\n },\n \"apple_pay_payment\": {\n \"payment_data\": {\n \"data\": \"<string>\",\n \"signature\": \"<string>\",\n \"header\": {\n \"ephemeral_public_key\": \"<string>\",\n \"public_key_hash\": \"<string>\",\n \"transaction_id\": \"<string>\"\n },\n \"version\": \"<string>\"\n },\n \"payment_method\": {\n \"display_name\": \"<string>\",\n \"network\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"transaction_identifier\": \"<string>\",\n \"name_on_card\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n },\n \"amount\": {\n \"value\": 500000000\n },\n \"order\": {\n \"customer_public_identifier\": \"<string>\",\n \"reference_object\": \"<string>\",\n \"reference_object_id\": 123,\n \"bill_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"ship_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"discount\": 123,\n \"surcharge\": 123,\n \"shipping\": 123,\n \"email\": \"<string>\",\n \"tip\": 123,\n \"tax\": 123,\n \"total\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"product_code\": \"<string>\",\n \"description\": \"<string>\",\n \"commodity_code\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"unit_cost\": 123,\n \"quantity\": 123,\n \"total\": 123,\n \"tax\": 123,\n \"tax_rate\": 123,\n \"discount\": 123,\n \"discount_rate\": 123,\n \"tax_type\": \"<string>\",\n \"alternate_tax_id\": \"<string>\"\n }\n ],\n \"metadata\": {}\n },\n \"initiated_by_user_id\": 123,\n \"reference_transaction_id\": 123,\n \"customer_subscription_id\": 123\n}"
response = http.request(request)
puts response.read_body{
"transaction_id": "<string>",
"auth_code": "<string>",
"response_code": "<string>",
"response_text": "<string>",
"latency": 123,
"avs": {
"code": "<string>",
"text": "<string>"
},
"cvv": {
"code": "<string>",
"text": "<string>"
},
"amount": 123,
"metadata": {},
"request_id": "000000000000000000000",
"errors": [
{
"type": "<string>",
"message": null
}
]
}{
"errors": [
{
"type": "<string>",
"message": null
}
],
"request_id": "000000000000000000000"
}Transactions
Sale
DESCRIPTION
Supported Payment Methods
Credit Card
-Cloud EMV
Cash
ACH
POST
/
v1
/
transactions
/
sale
Sale
curl --request POST \
--url https://api.example.com/v1/transactions/sale \
--header 'Content-Type: application/json' \
--data '
{
"payment": {
"token": "<string>",
"stored": {
"customer": "<string>",
"wallet": "<string>",
"installment": 123,
"initial_transaction_id": "<string>"
},
"cash": true,
"credit_card_encrypted": "<string>",
"google_pay_payment": {
"signature": "<string>",
"intermediate_signing_key": {
"signed_key": "<string>",
"signatures": [
"<string>"
]
},
"protocol_version": "<string>",
"signed_message": "<string>",
"postal_code": "<string>",
"name_on_card": "<string>"
},
"apple_pay_payment": {
"payment_data": {
"data": "<string>",
"signature": "<string>",
"header": {
"ephemeral_public_key": "<string>",
"public_key_hash": "<string>",
"transaction_id": "<string>"
},
"version": "<string>"
},
"payment_method": {
"display_name": "<string>",
"network": "<string>",
"type": "<string>"
},
"transaction_identifier": "<string>",
"name_on_card": "<string>",
"postal_code": "<string>"
}
},
"amount": {
"value": 500000000
},
"order": {
"customer_public_identifier": "<string>",
"reference_object": "<string>",
"reference_object_id": 123,
"bill_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"ship_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"discount": 123,
"surcharge": 123,
"shipping": 123,
"email": "<string>",
"tip": 123,
"tax": 123,
"total": 123,
"date": "2023-11-07T05:31:56Z",
"lines": [
{
"product_code": "<string>",
"description": "<string>",
"commodity_code": "<string>",
"unit_of_measure": "<string>",
"unit_cost": 123,
"quantity": 123,
"total": 123,
"tax": 123,
"tax_rate": 123,
"discount": 123,
"discount_rate": 123,
"tax_type": "<string>",
"alternate_tax_id": "<string>"
}
],
"metadata": {}
},
"initiated_by_user_id": 123,
"reference_transaction_id": 123,
"customer_subscription_id": 123
}
'import requests
url = "https://api.example.com/v1/transactions/sale"
payload = {
"payment": {
"token": "<string>",
"stored": {
"customer": "<string>",
"wallet": "<string>",
"installment": 123,
"initial_transaction_id": "<string>"
},
"cash": True,
"credit_card_encrypted": "<string>",
"google_pay_payment": {
"signature": "<string>",
"intermediate_signing_key": {
"signed_key": "<string>",
"signatures": ["<string>"]
},
"protocol_version": "<string>",
"signed_message": "<string>",
"postal_code": "<string>",
"name_on_card": "<string>"
},
"apple_pay_payment": {
"payment_data": {
"data": "<string>",
"signature": "<string>",
"header": {
"ephemeral_public_key": "<string>",
"public_key_hash": "<string>",
"transaction_id": "<string>"
},
"version": "<string>"
},
"payment_method": {
"display_name": "<string>",
"network": "<string>",
"type": "<string>"
},
"transaction_identifier": "<string>",
"name_on_card": "<string>",
"postal_code": "<string>"
}
},
"amount": { "value": 500000000 },
"order": {
"customer_public_identifier": "<string>",
"reference_object": "<string>",
"reference_object_id": 123,
"bill_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"ship_to": {
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"discount": 123,
"surcharge": 123,
"shipping": 123,
"email": "<string>",
"tip": 123,
"tax": 123,
"total": 123,
"date": "2023-11-07T05:31:56Z",
"lines": [
{
"product_code": "<string>",
"description": "<string>",
"commodity_code": "<string>",
"unit_of_measure": "<string>",
"unit_cost": 123,
"quantity": 123,
"total": 123,
"tax": 123,
"tax_rate": 123,
"discount": 123,
"discount_rate": 123,
"tax_type": "<string>",
"alternate_tax_id": "<string>"
}
],
"metadata": {}
},
"initiated_by_user_id": 123,
"reference_transaction_id": 123,
"customer_subscription_id": 123
}
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({
payment: {
token: '<string>',
stored: {
customer: '<string>',
wallet: '<string>',
installment: 123,
initial_transaction_id: '<string>'
},
cash: true,
credit_card_encrypted: '<string>',
google_pay_payment: {
signature: '<string>',
intermediate_signing_key: {signed_key: '<string>', signatures: ['<string>']},
protocol_version: '<string>',
signed_message: '<string>',
postal_code: '<string>',
name_on_card: '<string>'
},
apple_pay_payment: {
payment_data: {
data: '<string>',
signature: '<string>',
header: {
ephemeral_public_key: '<string>',
public_key_hash: '<string>',
transaction_id: '<string>'
},
version: '<string>'
},
payment_method: {display_name: '<string>', network: '<string>', type: '<string>'},
transaction_identifier: '<string>',
name_on_card: '<string>',
postal_code: '<string>'
}
},
amount: {value: 500000000},
order: {
customer_public_identifier: '<string>',
reference_object: '<string>',
reference_object_id: 123,
bill_to: {
name: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>'
},
ship_to: {
name: '<string>',
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country: '<string>'
},
discount: 123,
surcharge: 123,
shipping: 123,
email: '<string>',
tip: 123,
tax: 123,
total: 123,
date: '2023-11-07T05:31:56Z',
lines: [
{
product_code: '<string>',
description: '<string>',
commodity_code: '<string>',
unit_of_measure: '<string>',
unit_cost: 123,
quantity: 123,
total: 123,
tax: 123,
tax_rate: 123,
discount: 123,
discount_rate: 123,
tax_type: '<string>',
alternate_tax_id: '<string>'
}
],
metadata: {}
},
initiated_by_user_id: 123,
reference_transaction_id: 123,
customer_subscription_id: 123
})
};
fetch('https://api.example.com/v1/transactions/sale', 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://api.example.com/v1/transactions/sale",
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([
'payment' => [
'token' => '<string>',
'stored' => [
'customer' => '<string>',
'wallet' => '<string>',
'installment' => 123,
'initial_transaction_id' => '<string>'
],
'cash' => true,
'credit_card_encrypted' => '<string>',
'google_pay_payment' => [
'signature' => '<string>',
'intermediate_signing_key' => [
'signed_key' => '<string>',
'signatures' => [
'<string>'
]
],
'protocol_version' => '<string>',
'signed_message' => '<string>',
'postal_code' => '<string>',
'name_on_card' => '<string>'
],
'apple_pay_payment' => [
'payment_data' => [
'data' => '<string>',
'signature' => '<string>',
'header' => [
'ephemeral_public_key' => '<string>',
'public_key_hash' => '<string>',
'transaction_id' => '<string>'
],
'version' => '<string>'
],
'payment_method' => [
'display_name' => '<string>',
'network' => '<string>',
'type' => '<string>'
],
'transaction_identifier' => '<string>',
'name_on_card' => '<string>',
'postal_code' => '<string>'
]
],
'amount' => [
'value' => 500000000
],
'order' => [
'customer_public_identifier' => '<string>',
'reference_object' => '<string>',
'reference_object_id' => 123,
'bill_to' => [
'name' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<string>'
],
'ship_to' => [
'name' => '<string>',
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country' => '<string>'
],
'discount' => 123,
'surcharge' => 123,
'shipping' => 123,
'email' => '<string>',
'tip' => 123,
'tax' => 123,
'total' => 123,
'date' => '2023-11-07T05:31:56Z',
'lines' => [
[
'product_code' => '<string>',
'description' => '<string>',
'commodity_code' => '<string>',
'unit_of_measure' => '<string>',
'unit_cost' => 123,
'quantity' => 123,
'total' => 123,
'tax' => 123,
'tax_rate' => 123,
'discount' => 123,
'discount_rate' => 123,
'tax_type' => '<string>',
'alternate_tax_id' => '<string>'
]
],
'metadata' => [
]
],
'initiated_by_user_id' => 123,
'reference_transaction_id' => 123,
'customer_subscription_id' => 123
]),
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://api.example.com/v1/transactions/sale"
payload := strings.NewReader("{\n \"payment\": {\n \"token\": \"<string>\",\n \"stored\": {\n \"customer\": \"<string>\",\n \"wallet\": \"<string>\",\n \"installment\": 123,\n \"initial_transaction_id\": \"<string>\"\n },\n \"cash\": true,\n \"credit_card_encrypted\": \"<string>\",\n \"google_pay_payment\": {\n \"signature\": \"<string>\",\n \"intermediate_signing_key\": {\n \"signed_key\": \"<string>\",\n \"signatures\": [\n \"<string>\"\n ]\n },\n \"protocol_version\": \"<string>\",\n \"signed_message\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"name_on_card\": \"<string>\"\n },\n \"apple_pay_payment\": {\n \"payment_data\": {\n \"data\": \"<string>\",\n \"signature\": \"<string>\",\n \"header\": {\n \"ephemeral_public_key\": \"<string>\",\n \"public_key_hash\": \"<string>\",\n \"transaction_id\": \"<string>\"\n },\n \"version\": \"<string>\"\n },\n \"payment_method\": {\n \"display_name\": \"<string>\",\n \"network\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"transaction_identifier\": \"<string>\",\n \"name_on_card\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n },\n \"amount\": {\n \"value\": 500000000\n },\n \"order\": {\n \"customer_public_identifier\": \"<string>\",\n \"reference_object\": \"<string>\",\n \"reference_object_id\": 123,\n \"bill_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"ship_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"discount\": 123,\n \"surcharge\": 123,\n \"shipping\": 123,\n \"email\": \"<string>\",\n \"tip\": 123,\n \"tax\": 123,\n \"total\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"product_code\": \"<string>\",\n \"description\": \"<string>\",\n \"commodity_code\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"unit_cost\": 123,\n \"quantity\": 123,\n \"total\": 123,\n \"tax\": 123,\n \"tax_rate\": 123,\n \"discount\": 123,\n \"discount_rate\": 123,\n \"tax_type\": \"<string>\",\n \"alternate_tax_id\": \"<string>\"\n }\n ],\n \"metadata\": {}\n },\n \"initiated_by_user_id\": 123,\n \"reference_transaction_id\": 123,\n \"customer_subscription_id\": 123\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://api.example.com/v1/transactions/sale")
.header("Content-Type", "application/json")
.body("{\n \"payment\": {\n \"token\": \"<string>\",\n \"stored\": {\n \"customer\": \"<string>\",\n \"wallet\": \"<string>\",\n \"installment\": 123,\n \"initial_transaction_id\": \"<string>\"\n },\n \"cash\": true,\n \"credit_card_encrypted\": \"<string>\",\n \"google_pay_payment\": {\n \"signature\": \"<string>\",\n \"intermediate_signing_key\": {\n \"signed_key\": \"<string>\",\n \"signatures\": [\n \"<string>\"\n ]\n },\n \"protocol_version\": \"<string>\",\n \"signed_message\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"name_on_card\": \"<string>\"\n },\n \"apple_pay_payment\": {\n \"payment_data\": {\n \"data\": \"<string>\",\n \"signature\": \"<string>\",\n \"header\": {\n \"ephemeral_public_key\": \"<string>\",\n \"public_key_hash\": \"<string>\",\n \"transaction_id\": \"<string>\"\n },\n \"version\": \"<string>\"\n },\n \"payment_method\": {\n \"display_name\": \"<string>\",\n \"network\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"transaction_identifier\": \"<string>\",\n \"name_on_card\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n },\n \"amount\": {\n \"value\": 500000000\n },\n \"order\": {\n \"customer_public_identifier\": \"<string>\",\n \"reference_object\": \"<string>\",\n \"reference_object_id\": 123,\n \"bill_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"ship_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"discount\": 123,\n \"surcharge\": 123,\n \"shipping\": 123,\n \"email\": \"<string>\",\n \"tip\": 123,\n \"tax\": 123,\n \"total\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"product_code\": \"<string>\",\n \"description\": \"<string>\",\n \"commodity_code\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"unit_cost\": 123,\n \"quantity\": 123,\n \"total\": 123,\n \"tax\": 123,\n \"tax_rate\": 123,\n \"discount\": 123,\n \"discount_rate\": 123,\n \"tax_type\": \"<string>\",\n \"alternate_tax_id\": \"<string>\"\n }\n ],\n \"metadata\": {}\n },\n \"initiated_by_user_id\": 123,\n \"reference_transaction_id\": 123,\n \"customer_subscription_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/transactions/sale")
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 \"payment\": {\n \"token\": \"<string>\",\n \"stored\": {\n \"customer\": \"<string>\",\n \"wallet\": \"<string>\",\n \"installment\": 123,\n \"initial_transaction_id\": \"<string>\"\n },\n \"cash\": true,\n \"credit_card_encrypted\": \"<string>\",\n \"google_pay_payment\": {\n \"signature\": \"<string>\",\n \"intermediate_signing_key\": {\n \"signed_key\": \"<string>\",\n \"signatures\": [\n \"<string>\"\n ]\n },\n \"protocol_version\": \"<string>\",\n \"signed_message\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"name_on_card\": \"<string>\"\n },\n \"apple_pay_payment\": {\n \"payment_data\": {\n \"data\": \"<string>\",\n \"signature\": \"<string>\",\n \"header\": {\n \"ephemeral_public_key\": \"<string>\",\n \"public_key_hash\": \"<string>\",\n \"transaction_id\": \"<string>\"\n },\n \"version\": \"<string>\"\n },\n \"payment_method\": {\n \"display_name\": \"<string>\",\n \"network\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"transaction_identifier\": \"<string>\",\n \"name_on_card\": \"<string>\",\n \"postal_code\": \"<string>\"\n }\n },\n \"amount\": {\n \"value\": 500000000\n },\n \"order\": {\n \"customer_public_identifier\": \"<string>\",\n \"reference_object\": \"<string>\",\n \"reference_object_id\": 123,\n \"bill_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"ship_to\": {\n \"name\": \"<string>\",\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country\": \"<string>\"\n },\n \"discount\": 123,\n \"surcharge\": 123,\n \"shipping\": 123,\n \"email\": \"<string>\",\n \"tip\": 123,\n \"tax\": 123,\n \"total\": 123,\n \"date\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"product_code\": \"<string>\",\n \"description\": \"<string>\",\n \"commodity_code\": \"<string>\",\n \"unit_of_measure\": \"<string>\",\n \"unit_cost\": 123,\n \"quantity\": 123,\n \"total\": 123,\n \"tax\": 123,\n \"tax_rate\": 123,\n \"discount\": 123,\n \"discount_rate\": 123,\n \"tax_type\": \"<string>\",\n \"alternate_tax_id\": \"<string>\"\n }\n ],\n \"metadata\": {}\n },\n \"initiated_by_user_id\": 123,\n \"reference_transaction_id\": 123,\n \"customer_subscription_id\": 123\n}"
response = http.request(request)
puts response.read_body{
"transaction_id": "<string>",
"auth_code": "<string>",
"response_code": "<string>",
"response_text": "<string>",
"latency": 123,
"avs": {
"code": "<string>",
"text": "<string>"
},
"cvv": {
"code": "<string>",
"text": "<string>"
},
"amount": 123,
"metadata": {},
"request_id": "000000000000000000000",
"errors": [
{
"type": "<string>",
"message": null
}
]
}{
"errors": [
{
"type": "<string>",
"message": null
}
],
"request_id": "000000000000000000000"
}Body
application/jsontext/jsonapplication/*+json
Payment requires that you submit only one of the below options:
TokenStoredTerminalCheckCash
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
OK
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required string length:
1 - 100Show child attributes
Show child attributes
⌘I