v0

New Purchase

Initializes the checkout flow, creating the Purchase object in the database with the state initiated.

post/purchases/{merchantId}

Request

  • Base URL: https://api.beamcheckout.com (the document declares no server; this is the origin it was published from)
  • URL: https://api.beamcheckout.com/purchases/{merchantId}
  • Auth: HTTP basic

Path parameters

merchantIdstring required

merchantId

Request body

channelstring

Channel through which the purchase is being made

expirystring

Expiry indicates the time, in ISO-8601 format, after which the purchase will expire If this property is not specified, the purchase will not expire

partnerstring

Partner field is used to track the Partner of this Purchase

redirectUrlstring

RedirectURL for frontend to redirect user to after successful payment Avoid putting sensitive information into redirect url as this will be available in public API

requiredFieldsFormIdstring

RequiredFieldsFormId is the form id for customer data form If not specified, no customer data will not be requested

supportedPaymentMethodsstring[]

SupportedPaymentMethods overrides the merchant's default payment method setting Payment method specified here must be enabled by the merchant

Example request

{
  "channel": "line",
  "order": {
    "currencyCode": "THB",
    "description": "1 Cookies Box",
    "merchantReference": "cookies order 1",
    "merchantReferenceId": "merchantRef1",
    "netAmount": 900,
    "orderItems": [
      {
        "product": {
          "name": "Cookies",
          "price": 1000
        }
      }
    ],
    "totalAmount": 1000,
    "totalDiscount": 100
  },
  "requiredFieldsFormId": "formId123",
  "supportedPaymentMethods": [
    "[\"creditCard\"]"
  ]
}

Response

success

paymentLinkstring
purchaseIdstring

Changes

No recorded changes to this operation across all 1 revision of this API.