Terminal ordering
📌
Overview of Terminal Ordering Process
Step 1: Fetch Available Hardware
GET /api/1/partner/merchant/{id}/hardware
endpoint to retrieve a list of available terminals and accessories. This data is used to present hardware options to the user.GET /api/1/partner/merchant/{id}/hardware
{
"data": [
{
"id": "36e82a3c-91d0-4df4-8dd7-2ce7e57a6da5",
"name": "m2",
"imageUrl": null,
"isDefaultCardReader": true,
"pricing": [
{
"id": null,
"primary": true,
"baseCost": {
"units": 2400,
"currencyCode": "USD"
},
"totalCost": {
"units": 3095,
"currencyCode": "USD"
},
"postageCost": {
"units": 695,
"currencyCode": "USD"
},
"taxCost": {
"units": 0,
"currencyCode": "USD"
},
"billingCycle": null
}
],
"accessories": []
},
{
"id": "ed21467d-3e0a-469c-9eb2-3b34361230bd",
"name": "s700",
"imageUrl": null,
"isDefaultCardReader": false,
"pricing": [
{
"id": null,
"primary": true,
"baseCost": {
"units": 29900,
"currencyCode": "USD"
},
"totalCost": {
"units": 30795,
"currencyCode": "USD"
},
"postageCost": {
"units": 895,
"currencyCode": "USD"
},
"taxCost": {
"units": 0,
"currencyCode": "USD"
},
"billingCycle": null
}
],
"accessories": []
}
]
}
Step 2: Calculate the total and present the total to the user
totalCost
of each selected item and return display it to the user.Step 3: Create the order
POST /api/1/partner/merchant/{id}/order-hardware
endpoint to create an order.POST /api/1/partner/merchant/{id}/order-hardware
{
"hardware": [
{
"id": "36e82a3c-91d0-4df4-8dd7-2ce7e57a6da5",
"quantity": 1
}
],
"deliveryAddress": {
"nameOrNumber": "#11",
"street": "132 My Street",
"town": "Kingston",
"state": "NY",
"postcode": "12401",
"phone": "+15555551234",
"deliveryNotes": "Leave at the back door"
},
// See React example below on how to obtain payment method ID
"stripePaymentMethodId": "pm_xxx"
}
{
"publishableKey": "pk_test_51KUBPnJLmLxc08DqBQBReWGPrCSwTAOIlVdkviZruZNq81LxtNNCtRjXRygJz5Z1YGCeqcjIkGjsGjqozjkpPzOj00BITCxYhp",
"clientSecret": "client_secret",
"ephemeralKey": {
"id": "ephemeral_key_id",
"object": "ephemeral_key",
"created": 1737546937,
"expires": 1737548393,
"livemode": false,
"secret": "ephemeral_key_secret"
},
"stripeCustomerId": "cus_xxx"
}
Integrating Stripe Elements
Installation
Example TypeScript Code
Summary
GET /api/1/partner/merchant/{id}/hardware
.POST /api/1/partner/merchant/{id}/order-hardware
.Modified at 2025-01-22 15:54:43