Scanned Codes

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

Attributes

  • 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  API . Can be paypal, venmo, farmlands or centrapay.

  • displayName

    string

    A formatted name that can be displayed in a client.

  • merchantConfigId

    string

POST/api/decode

This endpoint allows you to decode a scanned code.

Attributes

  • code

    stringrequired

    The utf8 representation of data decoded from what was scanned.

  • scannedBy

    stringrequired

    The party that scanned the code. Can be merchant.

  • merchantConfigId

    stringrequired

Errors

  • UNKNOWN_CODE

    403

    The code doesn’t exist or is no longer active in our system.

  • MERCHANT_CONFIG_NOT_FOUND

    403

    The supplied merchant config does not exist.

  • INVALID_MERCHANT_CONFIG

    403

    The merchant config does not have a payment option that can satisfy the scanned code.

Request
POST/api/decode
curl -X POST \
 https://service.centrapay.com/api/decode \
 -H 'content-type: application/json' \
 -H 'x-api-key: <TOKEN>' \
 -d '
{
 "code": "123456789",
 "scannedBy": "merchant",
 "merchantConfigId": "P9gm1s1Cu1Q5uooxs"
}
'
Response
{
  "code": "123456789",
  "scannedBy": "merchant",
  "merchantConfigId": "P9gm1s1Cu1Q5uooxs",
  "provider": "farmlands",
  "displayName": "Farmlands Card"
}