Skip to main content

Checkout code scans

POST /v2/retailer_transaction/checkout_code_scans

Use this operation to block in-store payment until Instacart has successfully validated codes sent by your point-of-sale system (POS). Implementing this API helps ensure your system gets the data it needs to carry out various operations, such as tax suppression, loyalty program management, and order mapping.

For more information, see In-store checkout code scans.

Security​

NameInDescription
AuthorizationheaderThe Authorization header with the bearer token acquired during authentication.

For more information, see Get an access token.

Parameters​

None.

Request​

FieldTypeRequiredDescription
store_idstringRequired

The identifier of the store, as defined by the retailer.

code_scansArray(CheckoutCodeScan)Required

A list of the codes scanned by your POS.

CheckoutCodeScan Object​

FieldTypeRequiredDescription
codestringRequired

The checkout code scanned by the POS. Its format depends on your specific implementation. Pass its value through verbatim, without transformation.

scan_timestringOptional

When the code was scanned. The timestamp is validated but not used in processing logic. Potentially useful for auditing purposes.

Must be in ISO 8601 format. UTC and explicit timezone offsets are accepted.

Request examples​

curl --request POST \
--url https://connect.instacart.com/v2/retailer_transaction/checkout_code_scans \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"store_id": "string",
"code_scans": [
{
"code": "string",
"scan_time": "string"
}
]
}'

Response​

If one or more of the CheckoutCodeScan objects you provided are not found in Instacart’s system or the associated order is in a non-checkout state, then status has a value of Error and the errors array contains a list of all the scans that failed. Otherwise, status is Ok and errors is not present.

If the request is malformed or missing required fields, then a 400 Bad Request is returned with error and meta fields that can be used to identify the problem. For more information, see Understanding scan failures.

FieldTypeRequiredDescription
statusstringOptional

The status of all the code scans. Its value is Ok when all the scans are accepted or Error when one or more of the scans failed.

errorsArray(CheckoutCodeScanError)Optional

A list of checkout code scan errors. Only present when status is Error. Each entry in the list maps to a failed scan code.

CheckoutCodeScanError Object​

FieldTypeRequiredDescription
scan_codestringRequired

If the request contains an invalid CheckoutCodeScan, then that object’s code is assigned to this field.

error_codestringRequired

A machine-readable error code.

errorstringRequired

A human-readable description of the error. Some possible values include Code is not found in the system, Code is found but the corresponding order is not in checkout, and Invalid code.

The specific values are dependent on your implementation. For more information, contact your Instacart development team.

Response examples​

Success

{
"status": "Error",
"errors": [
{
"scan_code": "12345",
"error_code": "1002",
"error": "Invalid code"
}
]
}

4XX Errors

Error responses return either a single error or multiple errors.

HTTP CodeCauseError MessageError CodeError Meta
400store_id is missing"can't be blank"1001{"key":"store_id"}
400code_scans is missing"can't be blank"1001{"key":"code_scans"}
400code is missing"can't be blank"1001{"key":"code_scans[0].code"}
400scan_time is not a valid ISO 8601 timestamp"is not a valid ISO 8601 formatted timestamp"1001{"key":"code_scans[0].scan_time"}