OneBasket

Create a payment intent

POST
/baskets/{id}/payment-intents

Creates a new payment intent so that checkout can begin.

Authorization

BearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

The id of the basket

Header Parameters

x-api-key*string

Request Body

application/json

Additional data to be passed to the payment provider

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/baskets/string/payment-intents" \  -H "x-api-key: string" \  -H "Content-Type: application/json" \  -d '{    "property1": null,    "property2": null  }'
{  "id": "string",  "status": "PreparingPayment",  "created": "2019-08-24T14:15:22Z",  "updated": "2019-08-24T14:15:22Z",  "paymentDetails": {    "totalPaid": {      "minorUnits": 0,      "currencyCode": "string",      "precision": 0    },    "components": [      {        "providerBasketId": "string",        "portionOfTotalPaid": {          "minorUnits": 0,          "currencyCode": "string",          "precision": 0        }      }    ]  },  "creationStateMachine": {    "pendingProviderBasjets": [      "string"    ],    "pendingPaymentProvider": true,    "notificationId": "string",    "ready": true  },  "cancellationStateMachine": {    "pendingProviderBasjets": [      "string"    ],    "pendingPaymentProvider": true,    "notificationId": "string",    "ready": true  },  "pspPaymentreference": "string",  "pspPayload": {    "property1": null,    "property2": null  }}