LogoLogo
  • Welcome
  • Merchant API
    • Authentication
    • Card linking Receipt API
    • Token Receipt API
    • Dynamic QR Code
  • Partner App API
    • Authentication
    • OAuth2 Flow
    • GET Receipt
    • Notifications
  • Issuers
    • Issuer flow
    • Bank Piloting
    • Notifications
  • Filetypes
    • ReceiptHero JSON
      • HeroJSON Specification
        • Payment Types
    • Finvoice XML eReceipt
  • Support
    • Slack channel
Powered by GitBook
On this page
  • Examples
  • Token object
  • Response OK
  1. Merchant API

Token Receipt API

This API offers capabilities that extend beyond the standard Card Linking Receipt API, accommodating receipt delivery based on a variety of identifiers (tokens). It's essential to highlight that when using the Token Receipt API, receipts will consistently be delivered to users via the card linking solution when relevant. It is also possible to include several different tokens with a single request.

Examples

Dynamic QR Code

A Dynamic QR Code Token allows for the generation of receipts with unique identifiers, such as UUIDv4. This identifier is encoded into a QR code link, which is displayed for the customer on a customer-facing screen. By scanning this QR code with their mobile device, users can easily access and view their receipt.

POST /api/v1/receipts/ HTTP/1.1
Host: api.dev.receipthero.io
Authorization: Token <RECEIPTHERO_API_KEY>
Content-Type: application/json

{
  "attributes": {
    "tokens": [
      {
        "type": "DYNAMIC_QR_CODE",
        "value": "269654a1-7189-4c46-a9e7-44a29a78b442",
        "namespace": "partner-namespace",
      }
    ]
  },
  "receipt": <HEROJSON>
}

Card

Card Token is for Partners that are able to deliver card related token with receipt data.

POST /api/v1/receipts/ HTTP/1.1
Host: api.dev.receipthero.io
Authorization: Token <RECEIPTHERO_API_KEY>
Content-Type: application/json

{
  "attributes": {
    "tokens": [
      {
        "type": "CARD",
        "value": "bmxpbmUgSldMjksImV4cCI6MTY0NzcwNTIyOSwiYXVkIjoid3d3",
        "id": "parter-token-xyz",
      }
    ]
  },
  "receipt": <HEROJSON>
}

Email

POST /api/v1/receipts/ HTTP/1.1
Host: api.dev.receipthero.io
Authorization: Token <RECEIPTHERO_API_KEY>
Content-Type: application/json

{
  "attributes": {
    "tokens": [
      {
        "type": "EMAIL",
        "value": "john.smith@receipthero.io"
      }
    ]
  },
  "receipt": <HEROJSON>
}

User (OAuth2)

POST /api/v1/receipts HTTP/1.1
Host: api.dev.receipthero.io
Authorization: Token <RECEIPTHERO_API_KEY>
Content-Type: application/json

{
  "attributes": {
    "tokens": [
      {
        "type": "USER",
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJiYXIiLCJpYXQiOjE2MzI4MTMzNjJ9.RNW59YOlWD_CZy3dLomd2SMC6-cGfkW-IuYVgodwb5I"
      }
    ]
  },
  "receipt": <HEROJSON>
}

Token object

Key
Type
Description
Required

type

String

Token type: DYNAMIC_QR_CODE|CARD|EMAIL|USER

✅

value

String

Token value

✅

id

String

Token identifier (Defined by the Partner)

Required when Token type = CARD

namespace

String

Partner namespace (defined by ReceiptHero)

Required when token type = DYNAMIC_QR_CODE

Response OK

HTTP 200 OK
Content-Type: application/json

PreviousCard linking Receipt APINextDynamic QR Code

Last updated 7 months ago

as <HeroJSON>

ReceiptHero JSON