Send point of sale transaction information
POST /v2/retailer_transaction/pos_transactions
Sends point of sale (POS) transaction information to Instacart. Instacart uses the POS transaction information to match POS transactions to online transactions and to audit orders.
Best Practice
Send transaction information within 10 minutes of finalizing the transaction to ensure seamless reconciliation and timely payments.
Security
Field | In | Description |
---|---|---|
Authorization | header | The Authorization header with the bearer token acquired during authentication. |
Request
Field | Type | Required | Description |
---|---|---|---|
bin | string | The first six digits of the payment card. One of 539186 , 546683 , 555370 , or 551917 . | |
last_four | string | The last four digits of the primary account number or payment card number. For example: 7890. | |
transaction_timestamp | string | The time of the transaction. Append the timezone at the end or use the UTC format. For example: 2022-03-09T11:37:00-5:00 or 2022-03-09T16:37:00Z. | |
id | string | The global unique identifier for the transaction across all stores and banners. Avoid reusing the ID. For example: 847473. | |
store_id | string | The identifier for the store. For example: 4211. | |
checkout_id | string | The identifier submitted in checkout registration. | |
sub_total | number | The total for the transaction, excluding taxes and fees. For example: 10.23. | |
total | number | The total for the transaction, including taxes and fees. For example: 12.32. | |
currency_code | string | The currency type in ISO 4217 format. Default is USD. | |
total_tax | number | The total tax for the transaction. For example: 1.25. | |
cardholder_name | string | The name associated with the payment card. For example: Instacart 12345. | |
customer_reference | string | Customer reference. For example, an ID, email, or phone number. | |
tenders | Array(PosTender) | The various ways the transaction was paid for. | |
items | Array(PosItem) | The items involved in the transaction. | |
taxes | Array(PosTax) | The taxes and fees for the transaction. |
PosTender Object
Field | Type | Required | Description |
---|---|---|---|
type | string | The type of tender. One of CASH , CREDIT_CARD , DEBIT_CARD , GIFT_CARD , BYPASS , or REFUND . | |
amount | number | The amount that this tender contributed to paying for the transaction. | |
id | string | When the tender type is BYPASS , the ID is the pos_checkout_request_id . | |
approval_processed_by_code | string | The system that approved the process. One of RETAILER or INSTACART . |
PosItem Object
Field | Type | Required | Description |
---|---|---|---|
line_item_number | string | The unique identifier for the item in the transaction. | |
bar_code | string | 1 | The barcode or PLU of the item. |
retailer_reference_code | string | 1 | The unique identifier for this item in the retailer's catalog. This should be the same unique identifier sent in the inventory files. |
description | string | The name of the item. | |
category | string | A general classification of the item. | |
price_per_unit | number | The price of each individual unit of this item. For example, price per pound for produce. | |
item_price | number | The total price of the item excluding taxes and discounts. For voided items, enter this value as a negative value. | |
quantity | integer | The amount of the item. For weighted items, the value is 1 . For voided items, enter this value as a negative value. | |
weight | number | 2 | The weight of a weighted item. Exclude this field for unweighted items. If measure_method is PREPACKAGED_BY_WEIGHT or LOOSE_RANDOM_WEIGHT_BASED , then this field is required. For voided items, enter this value as a negative value. |
weight_unit | string | 2 | The unit of measure of a weighted item. Exclude this field for unweighted items. One of lb , kg , g , or oz . If measure_method is PREPACKAGED_BY_WEIGHT or LOOSE_RANDOM_WEIGHT_BASED , then this field is required. |
alcohol | boolean | Whether the item is an alcohol item and subject to stricter handling guidelines by the shopper. | |
tobacco | boolean | Whether the item is a tobacco item and subject to stricter handling guidelines by the shopper. | |
weight_certified | boolean | Whether the item weight is certified by the retailer. | |
bar_code_missing_reason | string | The reason why a barcode is missing. If this field is provided, then leave bar_code and retailer_reference_code blank. | |
measure_method | string | The method used to measure item numbers or weights. One of QUANTITY_BASED , PREPACKAGED_BY_WEIGHT , or LOOSE_RANDOM_WEIGHT_BASED . | |
taxes | Array(PosTax) | The taxes and fees for this item in the transaction. |
- You must provide either the
bar_code
orretailer_reference_code
. - If the
measure_method
isPREPACKAGED_BY_WEIGHT
orLOOSE_RANDOM_WEIGHT_BASED
, then theweight
andweight_unit
are required.
PosTax Object
Field | Type | Required | Description |
---|---|---|---|
type | string | The type of tax. One of OTHER , SALES_TAX_STATE , SALES_TAX_CITY , SALES_TAX_COUNTRY , SALES_TAX_LOCAL_TAX , ALCOHOL_TAX , BAG_FEE , BATTERY_RECYCLING_FEE , BEVERAGE_CONTAINER_FEE , EXCISE , POISON_CONTROL , PREPARED_FOOD_MEALS_TAX , FEE , or RECYCLING_FEE . | |
type_other | string | A freeform text representation of a tax type not captured by the type field. For example, custom taxes added by municipalities. | |
amount | number | The amount of tax in dollars. For example, use 2.75 to represent $2.75. | |
rate | number | The tax or fee rate. For example, use 5.25 to represent 5.25% tax. For type BAG_FEE , this field is used to indicate the number of bags used (2.0 for 2 bags). | |
flat_rate | number | The flat-fee tax rate. For example, use 2.75 to represent $2.75. | |
taxable_amount | number | The total taxable amount. |
Request examples
- cURL
- Java
- Python
- Go
curl --request POST \
--url https://connect.instacart.com/v2/retailer_transaction/pos_transactions \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"bin": "string",
"last_four": "string",
"transaction_timestamp": "string",
"id": "string",
"store_id": "string",
"checkout_id": "string",
"sub_total": 1,
"total": 1,
"currency_code": "string",
"total_tax": 1,
"cardholder_name": "string",
"customer_reference": "string",
"tenders": [
{
"type": "CASH",
"amount": 1,
"id": "string",
"approval_processed_by_code": "INSTACART"
}
],
"items": [
{
"line_item_number": "string",
"bar_code": "string",
"retailer_reference_code": "string",
"description": "string",
"category": "string",
"price_per_unit": 1,
"item_price": 1,
"quantity": 1,
"weight": 1,
"weight_unit": "string",
"alcohol": true,
"tobacco": true,
"weight_certified": true,
"bar_code_missing_reason": "string",
"measure_method": "string",
"taxes": [
{
"type": "OTHER",
"type_other": "string",
"amount": 1,
"rate": 1,
"flat_rate": 1,
"taxable_amount": 1
}
]
}
],
"taxes": [
{
"type": "OTHER",
"type_other": "string",
"amount": 1,
"rate": 1,
"flat_rate": 1,
"taxable_amount": 1
}
]
}'
HttpResponse<String> response = Unirest.post("https://connect.instacart.com/v2/retailer_transaction/pos_transactions")
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer <token>")
.body("{\n \"bin\": \"string\",\n \"last_four\": \"string\",\n \"transaction_timestamp\": \"string\",\n \"id\": \"string\",\n \"store_id\": \"string\",\n \"checkout_id\": \"string\",\n \"sub_total\": 1,\n \"total\": 1,\n \"currency_code\": \"string\",\n \"total_tax\": 1,\n \"cardholder_name\": \"string\",\n \"customer_reference\": \"string\",\n \"tenders\": [\n {\n \"type\": \"CASH\",\n \"amount\": 1,\n \"id\": \"string\",\n \"approval_processed_by_code\": \"INSTACART\"\n }\n ],\n \"items\": [\n {\n \"line_item_number\": \"string\",\n \"bar_code\": \"string\",\n \"retailer_reference_code\": \"string\",\n \"description\": \"string\",\n \"category\": \"string\",\n \"price_per_unit\": 1,\n \"item_price\": 1,\n \"quantity\": 1,\n \"weight\": 1,\n \"weight_unit\": \"string\",\n \"alcohol\": true,\n \"tobacco\": true,\n \"weight_certified\": true,\n \"bar_code_missing_reason\": \"string\",\n \"measure_method\": \"string\",\n \"taxes\": [\n {\n \"type\": \"OTHER\",\n \"type_other\": \"string\",\n \"amount\": 1,\n \"rate\": 1,\n \"flat_rate\": 1,\n \"taxable_amount\": 1\n }\n ]\n }\n ],\n \"taxes\": [\n {\n \"type\": \"OTHER\",\n \"type_other\": \"string\",\n \"amount\": 1,\n \"rate\": 1,\n \"flat_rate\": 1,\n \"taxable_amount\": 1\n }\n ]\n}")
.asString();
import http.client
conn = http.client.HTTPSConnection("connect.instacart.com")
payload = "{\n \"bin\": \"string\",\n \"last_four\": \"string\",\n \"transaction_timestamp\": \"string\",\n \"id\": \"string\",\n \"store_id\": \"string\",\n \"checkout_id\": \"string\",\n \"sub_total\": 1,\n \"total\": 1,\n \"currency_code\": \"string\",\n \"total_tax\": 1,\n \"cardholder_name\": \"string\",\n \"customer_reference\": \"string\",\n \"tenders\": [\n {\n \"type\": \"CASH\",\n \"amount\": 1,\n \"id\": \"string\",\n \"approval_processed_by_code\": \"INSTACART\"\n }\n ],\n \"items\": [\n {\n \"line_item_number\": \"string\",\n \"bar_code\": \"string\",\n \"retailer_reference_code\": \"string\",\n \"description\": \"string\",\n \"category\": \"string\",\n \"price_per_unit\": 1,\n \"item_price\": 1,\n \"quantity\": 1,\n \"weight\": 1,\n \"weight_unit\": \"string\",\n \"alcohol\": true,\n \"tobacco\": true,\n \"weight_certified\": true,\n \"bar_code_missing_reason\": \"string\",\n \"measure_method\": \"string\",\n \"taxes\": [\n {\n \"type\": \"OTHER\",\n \"type_other\": \"string\",\n \"amount\": 1,\n \"rate\": 1,\n \"flat_rate\": 1,\n \"taxable_amount\": 1\n }\n ]\n }\n ],\n \"taxes\": [\n {\n \"type\": \"OTHER\",\n \"type_other\": \"string\",\n \"amount\": 1,\n \"rate\": 1,\n \"flat_rate\": 1,\n \"taxable_amount\": 1\n }\n ]\n}"
headers = {
'Accept': "application/json",
'Content-Type': "application/json",
'Authorization': "Bearer <token>"
}
conn.request("POST", "/v2/retailer_transaction/pos_transactions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://connect.instacart.com/v2/retailer_transaction/pos_transactions"
payload := strings.NewReader("{\n \"bin\": \"string\",\n \"last_four\": \"string\",\n \"transaction_timestamp\": \"string\",\n \"id\": \"string\",\n \"store_id\": \"string\",\n \"checkout_id\": \"string\",\n \"sub_total\": 1,\n \"total\": 1,\n \"currency_code\": \"string\",\n \"total_tax\": 1,\n \"cardholder_name\": \"string\",\n \"customer_reference\": \"string\",\n \"tenders\": [\n {\n \"type\": \"CASH\",\n \"amount\": 1,\n \"id\": \"string\",\n \"approval_processed_by_code\": \"INSTACART\"\n }\n ],\n \"items\": [\n {\n \"line_item_number\": \"string\",\n \"bar_code\": \"string\",\n \"retailer_reference_code\": \"string\",\n \"description\": \"string\",\n \"category\": \"string\",\n \"price_per_unit\": 1,\n \"item_price\": 1,\n \"quantity\": 1,\n \"weight\": 1,\n \"weight_unit\": \"string\",\n \"alcohol\": true,\n \"tobacco\": true,\n \"weight_certified\": true,\n \"bar_code_missing_reason\": \"string\",\n \"measure_method\": \"string\",\n \"taxes\": [\n {\n \"type\": \"OTHER\",\n \"type_other\": \"string\",\n \"amount\": 1,\n \"rate\": 1,\n \"flat_rate\": 1,\n \"taxable_amount\": 1\n }\n ]\n }\n ],\n \"taxes\": [\n {\n \"type\": \"OTHER\",\n \"type_other\": \"string\",\n \"amount\": 1,\n \"rate\": 1,\n \"flat_rate\": 1,\n \"taxable_amount\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
Response
Field | Type | Required | Description |
---|---|---|---|
id | string | ID of the transaction submitted. |
Response examples
200 Success
- 200 Request successful
{
"id": "transaction-id-123"
}
4XX Errors
Error responses return either a single error or multiple errors.
HTTP Code | Cause | Error Message | Error Code | Error Meta |
---|---|---|---|---|
400 | Request fails | "invalid input" | 1001 | Not applicable |