Order

Create and pay for an e-commerce order.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Overview

Create an e-commerce order for the authenticated customer. When a payment source or gateway token is supplied, the order is charged immediately; the response returns the created order under data.order. The customer is taken from the JWT.

Example:

curl --request POST \n  --url 'https://www.pelcro.com/api/v1/sdk/ecommerce/order?site_id=1232' \n  --header 'Authorization: Bearer <JWT>' \n  --header 'Content-Type: application/json' \n  --data '{
    "items": [{ "sku_id": 101, "quantity": 1 }],
    "payment_gateway": "stripe",
    "gateway_token": "tok_xxxxxxxxxxxx",
    "address_id": 55
  }'

Conditional Requirements

  • items is required — each entry needs sku_id and quantity (min 1), and each SKU must be eligible for the customer.
  • Pay with either a new card (payment_gateway + gateway_token) or an existing source_id.
  • address_id is required when the order contains shippable items or when e-commerce taxes are enabled; it must belong to the customer.
  • coupon_code and campaign_key are optional.
  • All SKUs in one order must share the same currency.
  • A declined card or an unknown address/SKU returns 404.
Query Params
int32
required

The unique identifier of the site associated with your account.

Body Params
items
array of objects
required

A list of product SKUs and quantities to add to the order. Always required.

items*
int32
required

The unique identifier of an existing chargeable payment method already attached to the customer, which will be used to attempt payments for the order. Always required.

int32

The shipping address identifier. Always required.

string

An optional coupon code to apply a discount to the order. If you associated a customer segment to the coupon, a validation will be performed. Therefore, it is recommended to validate against eligible coupons for the customer first.

string

An optional campaign key associated to the subscription. If the key does not already exist, it will be created. The campaign key must be between 3 and 191 characters in length and include only letters, numbers, dashes and underscores without space.

string
enum
Defaults to stripe

The optional payment gateway, one of stripe, vantiv, tap or cybersource. Always defaults to stripe.

Allowed:
string

The single-use token that represents the payment method details. Typically generated using the payment gateway's tools and libraries. This payment method will be used to attempt payments for this newly created order.

Responses

Language
Credentials
Query
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json