v1

latestOpenAPI 3.0.12026-07-24204977.5 KB
Orders

Create order - QR / URL (dynamic)

Use this endpoint to create an order to accept payment using ShopBack’s dynamic QR code or to accept payments for an in-store context through a customer-facing app or website. This endpoint creates a payment order with the dynamic QR code or relevant URL for redirect.

post/posi-sandbox/v1/instore/order/create

Headers

Authorizationstring required
Example:SB1-HMAC-SHA256 <accessKeyId>:<hmacSignature>

Header required for authorization. Specify the HMAC signature in the Authorization header along with accessKeyId. Please refer to Generating an HMAC Signature for a step by step guide to generating the Authorization signature.

Datestring required
Example:2022-08-22T02:29:33.123Z

The date and time of request in <a href=https://en.wikipedia.org/wiki/ISO_8601 target="_blank">ISO-8601</a> format. This should be the same value used in the generation of the HMAC signature

X-ShopBack-Idempotent-Idstring
Example:faa5e09a-8cf3-43f7-8309-d94deb426e66

Idempotent Id for the request. If this is absent, every request will be treated as unique and will be processed as such. (This is optional for now, but will be made required in the future)

Request body

posIdstring required

Unique Id for the POS terminal given during onboarding.

country'SG' | 'HK' | 'AU' | 'MY' required

Two-letter ISO country code according to <a href=https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 target="_blank">ISO 3166-1 Alpha-2</a> standard.

amountnumber required

Transaction amount as integer. A positive integer in the smallest currency unit. For example:

  • SGD: in cents. 1234 stands for S$12.34
currency'SGD' | 'HKD' | 'AUD' | 'MYR' required

Currency that is associated with the payment amount. Specify the three-letter ISO currency code following <a href=https://en.wikipedia.org/wiki/ISO_4217 target="_blank">ISO 4217</a> standard, in UPPERCASE.

referenceIdstring required

A unique payment identifier generated by the POS terminal. This must be unique for every payment attempt.

qrType'base64' | 'payload' | 'url_payload' required

Type of QR.

{"stackTrail":"components:schemas:SandboxCreateOrderReqDto:properties:webhookUrl","oasType":"schema","type":"unknown","description":"The url to which ShopBack partner wants to receive payment notification webhook."}

Example request

{
  "posId": "802c987em7f747269a5e6c260c630kpl",
  "country": "SG",
  "amount": 1234,
  "currency": "SGD",
  "referenceId": "352c530dd7f747161a5e6c990c720bec",
  "qrType": "base64",
  "partner": {
    "merchantEntityId": "UEN in Singapore"
  },
  "orderMetadata": {
    "terminalReference": "TW001271r-CEalBMhQw",
    "merchantOrderReference": "7YaEQwQi-3c6aRCJbz0N"
  }
}

Response

referenceIdstring required

The unique payment attempt identifier generated by the POS terminal that was sent in the request to POST /v1/instore/order/create or POST /v1/instore/order/scan.

qrType'base64' | 'payload' | 'url_payload' required

Type of QR code returned, as specified in request.

qrCodestring required

Dynamic QR code according to qrType.

traceIdstring required

A unique identifier for this API response. This will be used for reconciliation as necessary.

Example response

{
  "qrType": "base64",
  "qrCode": "data:image/png;base64,iVBORw0KGgoAAAAN...",
  "traceId": "0dc44317-1c4b-4b62-83a8-8997435511e4",
  "partner": {
    "merchantEntityId": "UEN in Singapore"
  },
  "orderMetadata": {
    "terminalReference": "TW001271r-CEalBMhQw",
    "merchantOrderReference": "7YaEQwQi-3c6aRCJbz0N"
  }
}