Scanned Codes

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

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. 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.


POST /api/decode

This endpoint allows you to decode a scanned code.

Attributes

  • code

    string required

    The utf8 representation of data decoded from what was scanned.

  • scannedBy

    string required

    The party that scanned the code. Can be merchant.

  • merchantConfigId

    string required

    The ID of the Merchant Config.

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
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"
}