cURL
curl --request PUT \
--url https://api.smartbills.io/v1/receipts/batch \
--header 'Content-Type: application/json' \
--data '
[
{
"businessId": 123,
"employeeId": 123,
"customer": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"taxExempt": true,
"tags": [
"<string>"
],
"currency": "<string>",
"acceptsMarketing": true,
"phoneNumber": "<string>"
},
"billingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"stateCode": "<string>",
"country": "<string>",
"countryCode": "<string>",
"postalCode": "<string>",
"location": {
"longitude": 123,
"latitude": 123
},
"googlePlaceId": "<string>",
"formattedAddress": "<string>"
},
"company": "<string>",
"phoneNumber": "<string>",
"email": "<string>"
},
"shippingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"stateCode": "<string>",
"country": "<string>",
"countryCode": "<string>",
"postalCode": "<string>",
"location": {
"longitude": 123,
"latitude": 123
},
"googlePlaceId": "<string>",
"formattedAddress": "<string>"
},
"company": "<string>",
"phoneNumber": "<string>",
"email": "<string>"
},
"items": [
{
"productId": 123,
"groupId": 123,
"price": 123,
"variantId": 123,
"quantity": 123,
"totalDiscount": 123,
"totalDuties": 123,
"total": 123,
"totalTaxes": 123,
"subTotal": 123,
"discounts": [
{
"promoCodeId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"name": "<string>"
}
],
"taxes": [
{
"taxId": 123,
"name": "<string>",
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123
}
],
"taxable": true
}
],
"itemGroups": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"displayOrder": 123,
"lineItems": [
{
"productId": 123,
"groupId": 123,
"price": 123,
"variantId": 123,
"quantity": 123,
"totalDiscount": 123,
"totalDuties": 123,
"total": 123,
"totalTaxes": 123,
"subTotal": 123,
"discounts": [
{
"promoCodeId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"name": "<string>"
}
],
"taxes": [
{
"taxId": 123,
"name": "<string>",
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123
}
],
"taxable": true
}
]
}
],
"currency": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"cancelledAt": "2023-11-07T05:31:56Z",
"cancelReason": "<string>",
"paymentStatus": "<string>",
"totalDiscounts": 123,
"taxes": [
{
"taxId": 123,
"name": "<string>",
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123
}
],
"taxesIncluded": true,
"totalTip": 123,
"totalDuties": 123,
"totalShipping": 123,
"totalWeight": 123,
"totalTaxes": 123,
"total": 123,
"subTotal": 123,
"receiptMetadata": {
"landingSite": "<string>",
"customerLocale": "<string>",
"refferingSite": "<string>",
"sourcePOS": "<string>",
"sourceName": "<string>",
"tags": "<string>",
"url": "<string>",
"browserMetadata": {
"acceptLanguage": "<string>",
"browserHeight": 123,
"browserIp": "<string>",
"browserWidth": 123,
"sessionHash": "<string>",
"userAgent": "<string>"
}
},
"locationId": 123,
"transactions": [
{}
],
"barcode": {
"text": "<string>"
},
"id": 123
}
]
'import requests
url = "https://api.smartbills.io/v1/receipts/batch"
payload = [
{
"businessId": 123,
"employeeId": 123,
"customer": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"taxExempt": True,
"tags": ["<string>"],
"currency": "<string>",
"acceptsMarketing": True,
"phoneNumber": "<string>"
},
"billingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"stateCode": "<string>",
"country": "<string>",
"countryCode": "<string>",
"postalCode": "<string>",
"location": {
"longitude": 123,
"latitude": 123
},
"googlePlaceId": "<string>",
"formattedAddress": "<string>"
},
"company": "<string>",
"phoneNumber": "<string>",
"email": "<string>"
},
"shippingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"stateCode": "<string>",
"country": "<string>",
"countryCode": "<string>",
"postalCode": "<string>",
"location": {
"longitude": 123,
"latitude": 123
},
"googlePlaceId": "<string>",
"formattedAddress": "<string>"
},
"company": "<string>",
"phoneNumber": "<string>",
"email": "<string>"
},
"items": [
{
"productId": 123,
"groupId": 123,
"price": 123,
"variantId": 123,
"quantity": 123,
"totalDiscount": 123,
"totalDuties": 123,
"total": 123,
"totalTaxes": 123,
"subTotal": 123,
"discounts": [
{
"promoCodeId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"name": "<string>"
}
],
"taxes": [
{
"taxId": 123,
"name": "<string>",
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123
}
],
"taxable": True
}
],
"itemGroups": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"displayOrder": 123,
"lineItems": [
{
"productId": 123,
"groupId": 123,
"price": 123,
"variantId": 123,
"quantity": 123,
"totalDiscount": 123,
"totalDuties": 123,
"total": 123,
"totalTaxes": 123,
"subTotal": 123,
"discounts": [
{
"promoCodeId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"name": "<string>"
}
],
"taxes": [
{
"taxId": 123,
"name": "<string>",
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123
}
],
"taxable": True
}
]
}
],
"currency": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"cancelledAt": "2023-11-07T05:31:56Z",
"cancelReason": "<string>",
"paymentStatus": "<string>",
"totalDiscounts": 123,
"taxes": [
{
"taxId": 123,
"name": "<string>",
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123
}
],
"taxesIncluded": True,
"totalTip": 123,
"totalDuties": 123,
"totalShipping": 123,
"totalWeight": 123,
"totalTaxes": 123,
"total": 123,
"subTotal": 123,
"receiptMetadata": {
"landingSite": "<string>",
"customerLocale": "<string>",
"refferingSite": "<string>",
"sourcePOS": "<string>",
"sourceName": "<string>",
"tags": "<string>",
"url": "<string>",
"browserMetadata": {
"acceptLanguage": "<string>",
"browserHeight": 123,
"browserIp": "<string>",
"browserWidth": 123,
"sessionHash": "<string>",
"userAgent": "<string>"
}
},
"locationId": 123,
"transactions": [{}],
"barcode": { "text": "<string>" },
"id": 123
}
]
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
businessId: 123,
employeeId: 123,
customer: {
firstName: '<string>',
lastName: '<string>',
email: '<string>',
taxExempt: true,
tags: ['<string>'],
currency: '<string>',
acceptsMarketing: true,
phoneNumber: '<string>'
},
billingAddress: {
firstName: '<string>',
lastName: '<string>',
name: '<string>',
address: {
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
stateCode: '<string>',
country: '<string>',
countryCode: '<string>',
postalCode: '<string>',
location: {longitude: 123, latitude: 123},
googlePlaceId: '<string>',
formattedAddress: '<string>'
},
company: '<string>',
phoneNumber: '<string>',
email: '<string>'
},
shippingAddress: {
firstName: '<string>',
lastName: '<string>',
name: '<string>',
address: {
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
stateCode: '<string>',
country: '<string>',
countryCode: '<string>',
postalCode: '<string>',
location: {longitude: 123, latitude: 123},
googlePlaceId: '<string>',
formattedAddress: '<string>'
},
company: '<string>',
phoneNumber: '<string>',
email: '<string>'
},
items: [
{
productId: 123,
groupId: 123,
price: 123,
variantId: 123,
quantity: 123,
totalDiscount: 123,
totalDuties: 123,
total: 123,
totalTaxes: 123,
subTotal: 123,
discounts: [
{
promoCodeId: 123,
amount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123,
name: '<string>'
}
],
taxes: [
{
taxId: 123,
name: '<string>',
totalAmount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123
}
],
taxable: true
}
],
itemGroups: [
{
id: 123,
name: '<string>',
description: '<string>',
displayOrder: 123,
lineItems: [
{
productId: 123,
groupId: 123,
price: 123,
variantId: 123,
quantity: 123,
totalDiscount: 123,
totalDuties: 123,
total: 123,
totalTaxes: 123,
subTotal: 123,
discounts: [
{
promoCodeId: 123,
amount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123,
name: '<string>'
}
],
taxes: [
{
taxId: 123,
name: '<string>',
totalAmount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123
}
],
taxable: true
}
]
}
],
currency: '<string>',
updatedAt: '2023-11-07T05:31:56Z',
cancelledAt: '2023-11-07T05:31:56Z',
cancelReason: '<string>',
paymentStatus: '<string>',
totalDiscounts: 123,
taxes: [
{
taxId: 123,
name: '<string>',
totalAmount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123
}
],
taxesIncluded: true,
totalTip: 123,
totalDuties: 123,
totalShipping: 123,
totalWeight: 123,
totalTaxes: 123,
total: 123,
subTotal: 123,
receiptMetadata: {
landingSite: '<string>',
customerLocale: '<string>',
refferingSite: '<string>',
sourcePOS: '<string>',
sourceName: '<string>',
tags: '<string>',
url: '<string>',
browserMetadata: {
acceptLanguage: '<string>',
browserHeight: 123,
browserIp: '<string>',
browserWidth: 123,
sessionHash: '<string>',
userAgent: '<string>'
}
},
locationId: 123,
transactions: [{}],
barcode: {text: '<string>'},
id: 123
}
])
};
fetch('https://api.smartbills.io/v1/receipts/batch', 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.smartbills.io/v1/receipts/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'businessId' => 123,
'employeeId' => 123,
'customer' => [
'firstName' => '<string>',
'lastName' => '<string>',
'email' => '<string>',
'taxExempt' => true,
'tags' => [
'<string>'
],
'currency' => '<string>',
'acceptsMarketing' => true,
'phoneNumber' => '<string>'
],
'billingAddress' => [
'firstName' => '<string>',
'lastName' => '<string>',
'name' => '<string>',
'address' => [
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'stateCode' => '<string>',
'country' => '<string>',
'countryCode' => '<string>',
'postalCode' => '<string>',
'location' => [
'longitude' => 123,
'latitude' => 123
],
'googlePlaceId' => '<string>',
'formattedAddress' => '<string>'
],
'company' => '<string>',
'phoneNumber' => '<string>',
'email' => '<string>'
],
'shippingAddress' => [
'firstName' => '<string>',
'lastName' => '<string>',
'name' => '<string>',
'address' => [
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'stateCode' => '<string>',
'country' => '<string>',
'countryCode' => '<string>',
'postalCode' => '<string>',
'location' => [
'longitude' => 123,
'latitude' => 123
],
'googlePlaceId' => '<string>',
'formattedAddress' => '<string>'
],
'company' => '<string>',
'phoneNumber' => '<string>',
'email' => '<string>'
],
'items' => [
[
'productId' => 123,
'groupId' => 123,
'price' => 123,
'variantId' => 123,
'quantity' => 123,
'totalDiscount' => 123,
'totalDuties' => 123,
'total' => 123,
'totalTaxes' => 123,
'subTotal' => 123,
'discounts' => [
[
'promoCodeId' => 123,
'amount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123,
'name' => '<string>'
]
],
'taxes' => [
[
'taxId' => 123,
'name' => '<string>',
'totalAmount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123
]
],
'taxable' => true
]
],
'itemGroups' => [
[
'id' => 123,
'name' => '<string>',
'description' => '<string>',
'displayOrder' => 123,
'lineItems' => [
[
'productId' => 123,
'groupId' => 123,
'price' => 123,
'variantId' => 123,
'quantity' => 123,
'totalDiscount' => 123,
'totalDuties' => 123,
'total' => 123,
'totalTaxes' => 123,
'subTotal' => 123,
'discounts' => [
[
'promoCodeId' => 123,
'amount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123,
'name' => '<string>'
]
],
'taxes' => [
[
'taxId' => 123,
'name' => '<string>',
'totalAmount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123
]
],
'taxable' => true
]
]
]
],
'currency' => '<string>',
'updatedAt' => '2023-11-07T05:31:56Z',
'cancelledAt' => '2023-11-07T05:31:56Z',
'cancelReason' => '<string>',
'paymentStatus' => '<string>',
'totalDiscounts' => 123,
'taxes' => [
[
'taxId' => 123,
'name' => '<string>',
'totalAmount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123
]
],
'taxesIncluded' => true,
'totalTip' => 123,
'totalDuties' => 123,
'totalShipping' => 123,
'totalWeight' => 123,
'totalTaxes' => 123,
'total' => 123,
'subTotal' => 123,
'receiptMetadata' => [
'landingSite' => '<string>',
'customerLocale' => '<string>',
'refferingSite' => '<string>',
'sourcePOS' => '<string>',
'sourceName' => '<string>',
'tags' => '<string>',
'url' => '<string>',
'browserMetadata' => [
'acceptLanguage' => '<string>',
'browserHeight' => 123,
'browserIp' => '<string>',
'browserWidth' => 123,
'sessionHash' => '<string>',
'userAgent' => '<string>'
]
],
'locationId' => 123,
'transactions' => [
[
]
],
'barcode' => [
'text' => '<string>'
],
'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.smartbills.io/v1/receipts/batch"
payload := strings.NewReader("[\n {\n \"businessId\": 123,\n \"employeeId\": 123,\n \"customer\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"<string>\",\n \"taxExempt\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"currency\": \"<string>\",\n \"acceptsMarketing\": true,\n \"phoneNumber\": \"<string>\"\n },\n \"billingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"googlePlaceId\": \"<string>\",\n \"formattedAddress\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"shippingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"googlePlaceId\": \"<string>\",\n \"formattedAddress\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"items\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": 123,\n \"variantId\": 123,\n \"quantity\": 123,\n \"totalDiscount\": 123,\n \"totalDuties\": 123,\n \"total\": 123,\n \"totalTaxes\": 123,\n \"subTotal\": 123,\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxable\": true\n }\n ],\n \"itemGroups\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"displayOrder\": 123,\n \"lineItems\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": 123,\n \"variantId\": 123,\n \"quantity\": 123,\n \"totalDiscount\": 123,\n \"totalDuties\": 123,\n \"total\": 123,\n \"totalTaxes\": 123,\n \"subTotal\": 123,\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxable\": true\n }\n ]\n }\n ],\n \"currency\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"cancelledAt\": \"2023-11-07T05:31:56Z\",\n \"cancelReason\": \"<string>\",\n \"paymentStatus\": \"<string>\",\n \"totalDiscounts\": 123,\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxesIncluded\": true,\n \"totalTip\": 123,\n \"totalDuties\": 123,\n \"totalShipping\": 123,\n \"totalWeight\": 123,\n \"totalTaxes\": 123,\n \"total\": 123,\n \"subTotal\": 123,\n \"receiptMetadata\": {\n \"landingSite\": \"<string>\",\n \"customerLocale\": \"<string>\",\n \"refferingSite\": \"<string>\",\n \"sourcePOS\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"tags\": \"<string>\",\n \"url\": \"<string>\",\n \"browserMetadata\": {\n \"acceptLanguage\": \"<string>\",\n \"browserHeight\": 123,\n \"browserIp\": \"<string>\",\n \"browserWidth\": 123,\n \"sessionHash\": \"<string>\",\n \"userAgent\": \"<string>\"\n }\n },\n \"locationId\": 123,\n \"transactions\": [\n {}\n ],\n \"barcode\": {\n \"text\": \"<string>\"\n },\n \"id\": 123\n }\n]")
req, _ := http.NewRequest("PUT", 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.put("https://api.smartbills.io/v1/receipts/batch")
.header("Content-Type", "application/json")
.body("[\n {\n \"businessId\": 123,\n \"employeeId\": 123,\n \"customer\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"<string>\",\n \"taxExempt\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"currency\": \"<string>\",\n \"acceptsMarketing\": true,\n \"phoneNumber\": \"<string>\"\n },\n \"billingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"googlePlaceId\": \"<string>\",\n \"formattedAddress\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"shippingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"googlePlaceId\": \"<string>\",\n \"formattedAddress\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"items\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": 123,\n \"variantId\": 123,\n \"quantity\": 123,\n \"totalDiscount\": 123,\n \"totalDuties\": 123,\n \"total\": 123,\n \"totalTaxes\": 123,\n \"subTotal\": 123,\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxable\": true\n }\n ],\n \"itemGroups\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"displayOrder\": 123,\n \"lineItems\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": 123,\n \"variantId\": 123,\n \"quantity\": 123,\n \"totalDiscount\": 123,\n \"totalDuties\": 123,\n \"total\": 123,\n \"totalTaxes\": 123,\n \"subTotal\": 123,\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxable\": true\n }\n ]\n }\n ],\n \"currency\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"cancelledAt\": \"2023-11-07T05:31:56Z\",\n \"cancelReason\": \"<string>\",\n \"paymentStatus\": \"<string>\",\n \"totalDiscounts\": 123,\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxesIncluded\": true,\n \"totalTip\": 123,\n \"totalDuties\": 123,\n \"totalShipping\": 123,\n \"totalWeight\": 123,\n \"totalTaxes\": 123,\n \"total\": 123,\n \"subTotal\": 123,\n \"receiptMetadata\": {\n \"landingSite\": \"<string>\",\n \"customerLocale\": \"<string>\",\n \"refferingSite\": \"<string>\",\n \"sourcePOS\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"tags\": \"<string>\",\n \"url\": \"<string>\",\n \"browserMetadata\": {\n \"acceptLanguage\": \"<string>\",\n \"browserHeight\": 123,\n \"browserIp\": \"<string>\",\n \"browserWidth\": 123,\n \"sessionHash\": \"<string>\",\n \"userAgent\": \"<string>\"\n }\n },\n \"locationId\": 123,\n \"transactions\": [\n {}\n ],\n \"barcode\": {\n \"text\": \"<string>\"\n },\n \"id\": 123\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smartbills.io/v1/receipts/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"businessId\": 123,\n \"employeeId\": 123,\n \"customer\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"<string>\",\n \"taxExempt\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"currency\": \"<string>\",\n \"acceptsMarketing\": true,\n \"phoneNumber\": \"<string>\"\n },\n \"billingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"googlePlaceId\": \"<string>\",\n \"formattedAddress\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"shippingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"googlePlaceId\": \"<string>\",\n \"formattedAddress\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"items\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": 123,\n \"variantId\": 123,\n \"quantity\": 123,\n \"totalDiscount\": 123,\n \"totalDuties\": 123,\n \"total\": 123,\n \"totalTaxes\": 123,\n \"subTotal\": 123,\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxable\": true\n }\n ],\n \"itemGroups\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"displayOrder\": 123,\n \"lineItems\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": 123,\n \"variantId\": 123,\n \"quantity\": 123,\n \"totalDiscount\": 123,\n \"totalDuties\": 123,\n \"total\": 123,\n \"totalTaxes\": 123,\n \"subTotal\": 123,\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxable\": true\n }\n ]\n }\n ],\n \"currency\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"cancelledAt\": \"2023-11-07T05:31:56Z\",\n \"cancelReason\": \"<string>\",\n \"paymentStatus\": \"<string>\",\n \"totalDiscounts\": 123,\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxesIncluded\": true,\n \"totalTip\": 123,\n \"totalDuties\": 123,\n \"totalShipping\": 123,\n \"totalWeight\": 123,\n \"totalTaxes\": 123,\n \"total\": 123,\n \"subTotal\": 123,\n \"receiptMetadata\": {\n \"landingSite\": \"<string>\",\n \"customerLocale\": \"<string>\",\n \"refferingSite\": \"<string>\",\n \"sourcePOS\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"tags\": \"<string>\",\n \"url\": \"<string>\",\n \"browserMetadata\": {\n \"acceptLanguage\": \"<string>\",\n \"browserHeight\": 123,\n \"browserIp\": \"<string>\",\n \"browserWidth\": 123,\n \"sessionHash\": \"<string>\",\n \"userAgent\": \"<string>\"\n }\n },\n \"locationId\": 123,\n \"transactions\": [\n {}\n ],\n \"barcode\": {\n \"text\": \"<string>\"\n },\n \"id\": 123\n }\n]"
response = http.request(request)
puts response.read_bodyReceipts
Put v1receiptsbatch
PUT
/
v1
/
receipts
/
batch
cURL
curl --request PUT \
--url https://api.smartbills.io/v1/receipts/batch \
--header 'Content-Type: application/json' \
--data '
[
{
"businessId": 123,
"employeeId": 123,
"customer": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"taxExempt": true,
"tags": [
"<string>"
],
"currency": "<string>",
"acceptsMarketing": true,
"phoneNumber": "<string>"
},
"billingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"stateCode": "<string>",
"country": "<string>",
"countryCode": "<string>",
"postalCode": "<string>",
"location": {
"longitude": 123,
"latitude": 123
},
"googlePlaceId": "<string>",
"formattedAddress": "<string>"
},
"company": "<string>",
"phoneNumber": "<string>",
"email": "<string>"
},
"shippingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"stateCode": "<string>",
"country": "<string>",
"countryCode": "<string>",
"postalCode": "<string>",
"location": {
"longitude": 123,
"latitude": 123
},
"googlePlaceId": "<string>",
"formattedAddress": "<string>"
},
"company": "<string>",
"phoneNumber": "<string>",
"email": "<string>"
},
"items": [
{
"productId": 123,
"groupId": 123,
"price": 123,
"variantId": 123,
"quantity": 123,
"totalDiscount": 123,
"totalDuties": 123,
"total": 123,
"totalTaxes": 123,
"subTotal": 123,
"discounts": [
{
"promoCodeId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"name": "<string>"
}
],
"taxes": [
{
"taxId": 123,
"name": "<string>",
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123
}
],
"taxable": true
}
],
"itemGroups": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"displayOrder": 123,
"lineItems": [
{
"productId": 123,
"groupId": 123,
"price": 123,
"variantId": 123,
"quantity": 123,
"totalDiscount": 123,
"totalDuties": 123,
"total": 123,
"totalTaxes": 123,
"subTotal": 123,
"discounts": [
{
"promoCodeId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"name": "<string>"
}
],
"taxes": [
{
"taxId": 123,
"name": "<string>",
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123
}
],
"taxable": true
}
]
}
],
"currency": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"cancelledAt": "2023-11-07T05:31:56Z",
"cancelReason": "<string>",
"paymentStatus": "<string>",
"totalDiscounts": 123,
"taxes": [
{
"taxId": 123,
"name": "<string>",
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123
}
],
"taxesIncluded": true,
"totalTip": 123,
"totalDuties": 123,
"totalShipping": 123,
"totalWeight": 123,
"totalTaxes": 123,
"total": 123,
"subTotal": 123,
"receiptMetadata": {
"landingSite": "<string>",
"customerLocale": "<string>",
"refferingSite": "<string>",
"sourcePOS": "<string>",
"sourceName": "<string>",
"tags": "<string>",
"url": "<string>",
"browserMetadata": {
"acceptLanguage": "<string>",
"browserHeight": 123,
"browserIp": "<string>",
"browserWidth": 123,
"sessionHash": "<string>",
"userAgent": "<string>"
}
},
"locationId": 123,
"transactions": [
{}
],
"barcode": {
"text": "<string>"
},
"id": 123
}
]
'import requests
url = "https://api.smartbills.io/v1/receipts/batch"
payload = [
{
"businessId": 123,
"employeeId": 123,
"customer": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"taxExempt": True,
"tags": ["<string>"],
"currency": "<string>",
"acceptsMarketing": True,
"phoneNumber": "<string>"
},
"billingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"stateCode": "<string>",
"country": "<string>",
"countryCode": "<string>",
"postalCode": "<string>",
"location": {
"longitude": 123,
"latitude": 123
},
"googlePlaceId": "<string>",
"formattedAddress": "<string>"
},
"company": "<string>",
"phoneNumber": "<string>",
"email": "<string>"
},
"shippingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"name": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"stateCode": "<string>",
"country": "<string>",
"countryCode": "<string>",
"postalCode": "<string>",
"location": {
"longitude": 123,
"latitude": 123
},
"googlePlaceId": "<string>",
"formattedAddress": "<string>"
},
"company": "<string>",
"phoneNumber": "<string>",
"email": "<string>"
},
"items": [
{
"productId": 123,
"groupId": 123,
"price": 123,
"variantId": 123,
"quantity": 123,
"totalDiscount": 123,
"totalDuties": 123,
"total": 123,
"totalTaxes": 123,
"subTotal": 123,
"discounts": [
{
"promoCodeId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"name": "<string>"
}
],
"taxes": [
{
"taxId": 123,
"name": "<string>",
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123
}
],
"taxable": True
}
],
"itemGroups": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"displayOrder": 123,
"lineItems": [
{
"productId": 123,
"groupId": 123,
"price": 123,
"variantId": 123,
"quantity": 123,
"totalDiscount": 123,
"totalDuties": 123,
"total": 123,
"totalTaxes": 123,
"subTotal": 123,
"discounts": [
{
"promoCodeId": 123,
"amount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123,
"name": "<string>"
}
],
"taxes": [
{
"taxId": 123,
"name": "<string>",
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123
}
],
"taxable": True
}
]
}
],
"currency": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"cancelledAt": "2023-11-07T05:31:56Z",
"cancelReason": "<string>",
"paymentStatus": "<string>",
"totalDiscounts": 123,
"taxes": [
{
"taxId": 123,
"name": "<string>",
"totalAmount": {
"amount": 123,
"currency": "<string>",
"conversion": {
"originalAmount": 123,
"originalCurrency": "<string>",
"exchangeRate": 123,
"convertedAt": "2023-11-07T05:31:56Z"
}
},
"percentage": 123
}
],
"taxesIncluded": True,
"totalTip": 123,
"totalDuties": 123,
"totalShipping": 123,
"totalWeight": 123,
"totalTaxes": 123,
"total": 123,
"subTotal": 123,
"receiptMetadata": {
"landingSite": "<string>",
"customerLocale": "<string>",
"refferingSite": "<string>",
"sourcePOS": "<string>",
"sourceName": "<string>",
"tags": "<string>",
"url": "<string>",
"browserMetadata": {
"acceptLanguage": "<string>",
"browserHeight": 123,
"browserIp": "<string>",
"browserWidth": 123,
"sessionHash": "<string>",
"userAgent": "<string>"
}
},
"locationId": 123,
"transactions": [{}],
"barcode": { "text": "<string>" },
"id": 123
}
]
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
businessId: 123,
employeeId: 123,
customer: {
firstName: '<string>',
lastName: '<string>',
email: '<string>',
taxExempt: true,
tags: ['<string>'],
currency: '<string>',
acceptsMarketing: true,
phoneNumber: '<string>'
},
billingAddress: {
firstName: '<string>',
lastName: '<string>',
name: '<string>',
address: {
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
stateCode: '<string>',
country: '<string>',
countryCode: '<string>',
postalCode: '<string>',
location: {longitude: 123, latitude: 123},
googlePlaceId: '<string>',
formattedAddress: '<string>'
},
company: '<string>',
phoneNumber: '<string>',
email: '<string>'
},
shippingAddress: {
firstName: '<string>',
lastName: '<string>',
name: '<string>',
address: {
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
stateCode: '<string>',
country: '<string>',
countryCode: '<string>',
postalCode: '<string>',
location: {longitude: 123, latitude: 123},
googlePlaceId: '<string>',
formattedAddress: '<string>'
},
company: '<string>',
phoneNumber: '<string>',
email: '<string>'
},
items: [
{
productId: 123,
groupId: 123,
price: 123,
variantId: 123,
quantity: 123,
totalDiscount: 123,
totalDuties: 123,
total: 123,
totalTaxes: 123,
subTotal: 123,
discounts: [
{
promoCodeId: 123,
amount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123,
name: '<string>'
}
],
taxes: [
{
taxId: 123,
name: '<string>',
totalAmount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123
}
],
taxable: true
}
],
itemGroups: [
{
id: 123,
name: '<string>',
description: '<string>',
displayOrder: 123,
lineItems: [
{
productId: 123,
groupId: 123,
price: 123,
variantId: 123,
quantity: 123,
totalDiscount: 123,
totalDuties: 123,
total: 123,
totalTaxes: 123,
subTotal: 123,
discounts: [
{
promoCodeId: 123,
amount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123,
name: '<string>'
}
],
taxes: [
{
taxId: 123,
name: '<string>',
totalAmount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123
}
],
taxable: true
}
]
}
],
currency: '<string>',
updatedAt: '2023-11-07T05:31:56Z',
cancelledAt: '2023-11-07T05:31:56Z',
cancelReason: '<string>',
paymentStatus: '<string>',
totalDiscounts: 123,
taxes: [
{
taxId: 123,
name: '<string>',
totalAmount: {
amount: 123,
currency: '<string>',
conversion: {
originalAmount: 123,
originalCurrency: '<string>',
exchangeRate: 123,
convertedAt: '2023-11-07T05:31:56Z'
}
},
percentage: 123
}
],
taxesIncluded: true,
totalTip: 123,
totalDuties: 123,
totalShipping: 123,
totalWeight: 123,
totalTaxes: 123,
total: 123,
subTotal: 123,
receiptMetadata: {
landingSite: '<string>',
customerLocale: '<string>',
refferingSite: '<string>',
sourcePOS: '<string>',
sourceName: '<string>',
tags: '<string>',
url: '<string>',
browserMetadata: {
acceptLanguage: '<string>',
browserHeight: 123,
browserIp: '<string>',
browserWidth: 123,
sessionHash: '<string>',
userAgent: '<string>'
}
},
locationId: 123,
transactions: [{}],
barcode: {text: '<string>'},
id: 123
}
])
};
fetch('https://api.smartbills.io/v1/receipts/batch', 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.smartbills.io/v1/receipts/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'businessId' => 123,
'employeeId' => 123,
'customer' => [
'firstName' => '<string>',
'lastName' => '<string>',
'email' => '<string>',
'taxExempt' => true,
'tags' => [
'<string>'
],
'currency' => '<string>',
'acceptsMarketing' => true,
'phoneNumber' => '<string>'
],
'billingAddress' => [
'firstName' => '<string>',
'lastName' => '<string>',
'name' => '<string>',
'address' => [
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'stateCode' => '<string>',
'country' => '<string>',
'countryCode' => '<string>',
'postalCode' => '<string>',
'location' => [
'longitude' => 123,
'latitude' => 123
],
'googlePlaceId' => '<string>',
'formattedAddress' => '<string>'
],
'company' => '<string>',
'phoneNumber' => '<string>',
'email' => '<string>'
],
'shippingAddress' => [
'firstName' => '<string>',
'lastName' => '<string>',
'name' => '<string>',
'address' => [
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'stateCode' => '<string>',
'country' => '<string>',
'countryCode' => '<string>',
'postalCode' => '<string>',
'location' => [
'longitude' => 123,
'latitude' => 123
],
'googlePlaceId' => '<string>',
'formattedAddress' => '<string>'
],
'company' => '<string>',
'phoneNumber' => '<string>',
'email' => '<string>'
],
'items' => [
[
'productId' => 123,
'groupId' => 123,
'price' => 123,
'variantId' => 123,
'quantity' => 123,
'totalDiscount' => 123,
'totalDuties' => 123,
'total' => 123,
'totalTaxes' => 123,
'subTotal' => 123,
'discounts' => [
[
'promoCodeId' => 123,
'amount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123,
'name' => '<string>'
]
],
'taxes' => [
[
'taxId' => 123,
'name' => '<string>',
'totalAmount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123
]
],
'taxable' => true
]
],
'itemGroups' => [
[
'id' => 123,
'name' => '<string>',
'description' => '<string>',
'displayOrder' => 123,
'lineItems' => [
[
'productId' => 123,
'groupId' => 123,
'price' => 123,
'variantId' => 123,
'quantity' => 123,
'totalDiscount' => 123,
'totalDuties' => 123,
'total' => 123,
'totalTaxes' => 123,
'subTotal' => 123,
'discounts' => [
[
'promoCodeId' => 123,
'amount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123,
'name' => '<string>'
]
],
'taxes' => [
[
'taxId' => 123,
'name' => '<string>',
'totalAmount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123
]
],
'taxable' => true
]
]
]
],
'currency' => '<string>',
'updatedAt' => '2023-11-07T05:31:56Z',
'cancelledAt' => '2023-11-07T05:31:56Z',
'cancelReason' => '<string>',
'paymentStatus' => '<string>',
'totalDiscounts' => 123,
'taxes' => [
[
'taxId' => 123,
'name' => '<string>',
'totalAmount' => [
'amount' => 123,
'currency' => '<string>',
'conversion' => [
'originalAmount' => 123,
'originalCurrency' => '<string>',
'exchangeRate' => 123,
'convertedAt' => '2023-11-07T05:31:56Z'
]
],
'percentage' => 123
]
],
'taxesIncluded' => true,
'totalTip' => 123,
'totalDuties' => 123,
'totalShipping' => 123,
'totalWeight' => 123,
'totalTaxes' => 123,
'total' => 123,
'subTotal' => 123,
'receiptMetadata' => [
'landingSite' => '<string>',
'customerLocale' => '<string>',
'refferingSite' => '<string>',
'sourcePOS' => '<string>',
'sourceName' => '<string>',
'tags' => '<string>',
'url' => '<string>',
'browserMetadata' => [
'acceptLanguage' => '<string>',
'browserHeight' => 123,
'browserIp' => '<string>',
'browserWidth' => 123,
'sessionHash' => '<string>',
'userAgent' => '<string>'
]
],
'locationId' => 123,
'transactions' => [
[
]
],
'barcode' => [
'text' => '<string>'
],
'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.smartbills.io/v1/receipts/batch"
payload := strings.NewReader("[\n {\n \"businessId\": 123,\n \"employeeId\": 123,\n \"customer\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"<string>\",\n \"taxExempt\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"currency\": \"<string>\",\n \"acceptsMarketing\": true,\n \"phoneNumber\": \"<string>\"\n },\n \"billingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"googlePlaceId\": \"<string>\",\n \"formattedAddress\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"shippingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"googlePlaceId\": \"<string>\",\n \"formattedAddress\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"items\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": 123,\n \"variantId\": 123,\n \"quantity\": 123,\n \"totalDiscount\": 123,\n \"totalDuties\": 123,\n \"total\": 123,\n \"totalTaxes\": 123,\n \"subTotal\": 123,\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxable\": true\n }\n ],\n \"itemGroups\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"displayOrder\": 123,\n \"lineItems\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": 123,\n \"variantId\": 123,\n \"quantity\": 123,\n \"totalDiscount\": 123,\n \"totalDuties\": 123,\n \"total\": 123,\n \"totalTaxes\": 123,\n \"subTotal\": 123,\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxable\": true\n }\n ]\n }\n ],\n \"currency\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"cancelledAt\": \"2023-11-07T05:31:56Z\",\n \"cancelReason\": \"<string>\",\n \"paymentStatus\": \"<string>\",\n \"totalDiscounts\": 123,\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxesIncluded\": true,\n \"totalTip\": 123,\n \"totalDuties\": 123,\n \"totalShipping\": 123,\n \"totalWeight\": 123,\n \"totalTaxes\": 123,\n \"total\": 123,\n \"subTotal\": 123,\n \"receiptMetadata\": {\n \"landingSite\": \"<string>\",\n \"customerLocale\": \"<string>\",\n \"refferingSite\": \"<string>\",\n \"sourcePOS\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"tags\": \"<string>\",\n \"url\": \"<string>\",\n \"browserMetadata\": {\n \"acceptLanguage\": \"<string>\",\n \"browserHeight\": 123,\n \"browserIp\": \"<string>\",\n \"browserWidth\": 123,\n \"sessionHash\": \"<string>\",\n \"userAgent\": \"<string>\"\n }\n },\n \"locationId\": 123,\n \"transactions\": [\n {}\n ],\n \"barcode\": {\n \"text\": \"<string>\"\n },\n \"id\": 123\n }\n]")
req, _ := http.NewRequest("PUT", 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.put("https://api.smartbills.io/v1/receipts/batch")
.header("Content-Type", "application/json")
.body("[\n {\n \"businessId\": 123,\n \"employeeId\": 123,\n \"customer\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"<string>\",\n \"taxExempt\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"currency\": \"<string>\",\n \"acceptsMarketing\": true,\n \"phoneNumber\": \"<string>\"\n },\n \"billingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"googlePlaceId\": \"<string>\",\n \"formattedAddress\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"shippingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"googlePlaceId\": \"<string>\",\n \"formattedAddress\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"items\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": 123,\n \"variantId\": 123,\n \"quantity\": 123,\n \"totalDiscount\": 123,\n \"totalDuties\": 123,\n \"total\": 123,\n \"totalTaxes\": 123,\n \"subTotal\": 123,\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxable\": true\n }\n ],\n \"itemGroups\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"displayOrder\": 123,\n \"lineItems\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": 123,\n \"variantId\": 123,\n \"quantity\": 123,\n \"totalDiscount\": 123,\n \"totalDuties\": 123,\n \"total\": 123,\n \"totalTaxes\": 123,\n \"subTotal\": 123,\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxable\": true\n }\n ]\n }\n ],\n \"currency\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"cancelledAt\": \"2023-11-07T05:31:56Z\",\n \"cancelReason\": \"<string>\",\n \"paymentStatus\": \"<string>\",\n \"totalDiscounts\": 123,\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxesIncluded\": true,\n \"totalTip\": 123,\n \"totalDuties\": 123,\n \"totalShipping\": 123,\n \"totalWeight\": 123,\n \"totalTaxes\": 123,\n \"total\": 123,\n \"subTotal\": 123,\n \"receiptMetadata\": {\n \"landingSite\": \"<string>\",\n \"customerLocale\": \"<string>\",\n \"refferingSite\": \"<string>\",\n \"sourcePOS\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"tags\": \"<string>\",\n \"url\": \"<string>\",\n \"browserMetadata\": {\n \"acceptLanguage\": \"<string>\",\n \"browserHeight\": 123,\n \"browserIp\": \"<string>\",\n \"browserWidth\": 123,\n \"sessionHash\": \"<string>\",\n \"userAgent\": \"<string>\"\n }\n },\n \"locationId\": 123,\n \"transactions\": [\n {}\n ],\n \"barcode\": {\n \"text\": \"<string>\"\n },\n \"id\": 123\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smartbills.io/v1/receipts/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"businessId\": 123,\n \"employeeId\": 123,\n \"customer\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"<string>\",\n \"taxExempt\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"currency\": \"<string>\",\n \"acceptsMarketing\": true,\n \"phoneNumber\": \"<string>\"\n },\n \"billingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"googlePlaceId\": \"<string>\",\n \"formattedAddress\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"shippingAddress\": {\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"stateCode\": \"<string>\",\n \"country\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"location\": {\n \"longitude\": 123,\n \"latitude\": 123\n },\n \"googlePlaceId\": \"<string>\",\n \"formattedAddress\": \"<string>\"\n },\n \"company\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"items\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": 123,\n \"variantId\": 123,\n \"quantity\": 123,\n \"totalDiscount\": 123,\n \"totalDuties\": 123,\n \"total\": 123,\n \"totalTaxes\": 123,\n \"subTotal\": 123,\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxable\": true\n }\n ],\n \"itemGroups\": [\n {\n \"id\": 123,\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"displayOrder\": 123,\n \"lineItems\": [\n {\n \"productId\": 123,\n \"groupId\": 123,\n \"price\": 123,\n \"variantId\": 123,\n \"quantity\": 123,\n \"totalDiscount\": 123,\n \"totalDuties\": 123,\n \"total\": 123,\n \"totalTaxes\": 123,\n \"subTotal\": 123,\n \"discounts\": [\n {\n \"promoCodeId\": 123,\n \"amount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123,\n \"name\": \"<string>\"\n }\n ],\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxable\": true\n }\n ]\n }\n ],\n \"currency\": \"<string>\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"cancelledAt\": \"2023-11-07T05:31:56Z\",\n \"cancelReason\": \"<string>\",\n \"paymentStatus\": \"<string>\",\n \"totalDiscounts\": 123,\n \"taxes\": [\n {\n \"taxId\": 123,\n \"name\": \"<string>\",\n \"totalAmount\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"conversion\": {\n \"originalAmount\": 123,\n \"originalCurrency\": \"<string>\",\n \"exchangeRate\": 123,\n \"convertedAt\": \"2023-11-07T05:31:56Z\"\n }\n },\n \"percentage\": 123\n }\n ],\n \"taxesIncluded\": true,\n \"totalTip\": 123,\n \"totalDuties\": 123,\n \"totalShipping\": 123,\n \"totalWeight\": 123,\n \"totalTaxes\": 123,\n \"total\": 123,\n \"subTotal\": 123,\n \"receiptMetadata\": {\n \"landingSite\": \"<string>\",\n \"customerLocale\": \"<string>\",\n \"refferingSite\": \"<string>\",\n \"sourcePOS\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"tags\": \"<string>\",\n \"url\": \"<string>\",\n \"browserMetadata\": {\n \"acceptLanguage\": \"<string>\",\n \"browserHeight\": 123,\n \"browserIp\": \"<string>\",\n \"browserWidth\": 123,\n \"sessionHash\": \"<string>\",\n \"userAgent\": \"<string>\"\n }\n },\n \"locationId\": 123,\n \"transactions\": [\n {}\n ],\n \"barcode\": {\n \"text\": \"<string>\"\n },\n \"id\": 123\n }\n]"
response = http.request(request)
puts response.read_bodyBody
application/jsontext/jsonapplication/*+json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
200
OK
Was this page helpful?
⌘I