Skip to content

Set Payment Method

Select a payment method for the order checkout.

Endpoint

POST /api/shop/checkout/payment-method

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesBearer token (customer login required)

Request Body

json
{
  "payment": {
    "method": "paypal"
  }
}

Payment Method Options

Common payment methods:

  • paypal - PayPal
  • stripe - Stripe
  • cod - Cash on Delivery
  • bank_transfer - Bank Transfer

Response Fields (200 OK)

FieldTypeDescription
paymentMethodobjectSelected payment method details
messagestringSuccess message

Payment Method Fields

FieldTypeDescription
methodstringPayment method code
titlestringDisplay name
descriptionstringMethod description
instructionsstringPayment instructions

Use Cases

  • Select PayPal payment
  • Choose credit card
  • Use cash on delivery
  • Select bank transfer
  • Finalize payment details

Validation Rules

  • Payment method must be available
  • Must have valid billing address
  • Some methods restricted by location
  • Payment may require additional setup

Released under the MIT License.