patch https://api-sandbox.setel.com/v1/checkout/sessions//finish
This API endpoint completes the checkout session once the PIN is verified.
Where to get
pinToken
The token is created from
userId
and user’spin
.
const crypto = require('crypto');
const getPinToken = (userId, pin) => {
return crypto.createHash('sha256').update(`${pin}${userId}`).digest('hex');
}
Related guide(s): Capture method, Retrieve all payment methods of a user, How payment intents work and Payment intent status.
Successful response payload data
Parameter | Data type | Description |
---|---|---|
merchantId | string | The merchant ID of a particular merchant. |
apiKey | string | The partner’s x-api-key used for authenticating partner's identity.This key is provided during the onboarding process. |
referenceId | string | A unique string to reference the checkout transaction. This can be an order ID, a cart ID, or something similar generated by the merchant’s side. |
referenceType | string | The name of service which initiated the checkout flow. |
capture | boolean | An identifier to see if the transaction is a captured transaction. More information can be found in the capture method page. |
amount | string | The total amount of all items after discounts and taxes. |
currency | string | The three-letter ISO currency code of the payment. Currently, only supports MYR which is the default value. |
paymentMethod | object | The payment method for this session. |
paymentMethod.family | string | The family the payment method belongs to. |
paymentMethod.type | string | The payment method type. |
paymentMethod.brand | string | The payment method brand. |
referenceMeta | object | An object to store additional information about the transaction (e.g., order details, etc.). |
referenceMeta.items | object | Stores an array of items that is included in the transaction. |
referenceMeta.items.itemName | string | Name and description of the item. |
referenceMeta.items.variationName | string | Item variation. E.g: M , Red . |
referenceMeta.items.unitPrice | float | The price per item. |
referenceMeta.items.quantity | integer | The number of items purchased. |
referenceMeta.items.totalPrice | float | Total price = item quantity x item unit price |
referenceMeta.items.totalDiscountedPrice | float | The total price after discount. |
referenceMeta.totalDiscount | float | The total amount of discount given. |
referenceMeta.subtotal | float | The total amount before applying any taxes or discount, fee, etc. |
referenceMeta.shippingFee | float | The shipping fee (applicable for e-commerce). |
referenceMeta.pumpNumber | string | The code for the pump being operated. |
referenceMeta.stationName | string | The name of the station where the operating pump is located. |
subMerchant | object | ⚠️Required for Third-Party Acquirers Partner's merchant information (lowest level merchant). This will be used to display on our checkout page and e-receipt. |
subMerchant.name | string | The name of partner's merchant. |
subMerchant.reference | string | The partner's merchant's ID provided by partners. |
id | string | The ID of the checkout session. |
paymentMethodDetail | object | Additional information about the payment method. |
paymentMethodDetail.paymentMethodId | string | The ID of the payment method used. This ID is the id from the Retrieve all payment methods of a user API. |
paymentMethodDetail.userId | string | The ID of the user. |
paymentProcessor | string | Indicates the service that processes the payment intent. |
paymentIntentId | string | The unique identifier for the payment transaction. More information can be found in the How payment intents work page. |
paymentIntentStatus | string | The current status of the payment intent. The full list of statuses can be found in the Payment intent status page. |
expirationTime | string | After this time, the session will expire. It is 900000 ms after creating a session. |
error | string | Displays the error that is returned by the Setel server. |
status | string | The status of the session. |
createdAt | date string | The time the checkout session was created. |
updatedAt | date string | The time the checkout session was last updated. |