Similarly to Checkout Widget and other Ingrid widgets, Receipt Widget should be embedded in a site controlled by Merchant.
Authentication and authorization
In order to load the widget with customer's order you will need an auth token. This token authenticates widget and authorizes it to access the resources.
To get your token send following GET request:
with following headers:
Authorization: Bearer PRIVATE_KEY_BASE64
- SITE_ID - your site ID,
- SESSION_ID - identifier of completed session that will be presented in Receipt widget
- PRIVATE_KEY_BASE64 - base64-encoded site private key
Private key must not be exposed to Customer's browser. Call the above API on the backend side and pass only the obtained token to the browser client.
In order to embed receipt widget on your page you need to add following
script tag to your HTML
This will fetch receipt widget bootstrap code and make it available as
window.IngridReceiptWidgetApi. To render widget, run
config with following arguments:
- AUTH_TOKEN - token obtained in previous step,
- CONTAINER_ID - HTML element to host receipt widget,
- SITE_ID, SESSION_ID - same as in preveious step.
The following languages are supported:
- English (Great Britain) - en-GB
- English (United States) - en-US
- Swedish - sv-SE
On stage environment, replace