Link Search Menu Expand Document

Scanned Codes

A scanned code is a barcode that a merchant scans. The code can be used to create a Payment Request.

Contents

Models

Scanned Code

Fields

Field Type Description
code String The utf8 representation of data decoded from what was scanned.
scannedBy String The party that scanned the code. Can be merchant.
provider String The integrator that owns the code. This can be used to calculate discounts on Line Items. Can be paypal, venmo, farmlands or centrapay.
displayName String A formatted name that can be displayed in a client.
merchantConfigId String The ID of the Merchant Config.

Operations

Decode Scanned Code

POST /api/decode

Decode Merchant Scanned Barcode

curl -X POST https://service.centrapay.com/api/decode \
  -H "Authorization: $jwt" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "123456789",
    "scannedBy": "merchant",
    "merchantConfigId": "P9gm1s1Cu1Q5uooxs"
  }'

Example response payload

{
  "code": "123456789",
  "scannedBy": "merchant",
  "merchantConfigId": "P9gm1s1Cu1Q5uooxs",
  "provider": "farmlands",
  "displayName": "Farmlands Card"
}

Error Responses

Status Code Description
403 UNKNOWN_CODE The code doesn’t exist in our system.
403 MERCHANT_CONFIG_NOT_FOUND The supplied merchant config does not exist.
403 INVALID_MERCHANT_CONFIG The merchant config does not have a payment option that can satisfy the scanned code.