Skip to main content
POST
/
dev
/
v1
/
orders
Create order from product line items
curl --request POST \
  --url https://api.shoppex.io/dev/v1/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "[email protected]",
  "coupon_code": "SPRING10",
  "gateway": "STRIPE",
  "title": "Starter Pack checkout",
  "custom_fields": {
    "source": "affiliate",
    "campaign": "spring_launch"
  },
  "items": [
    {
      "product_id": "prod_starter",
      "variant_id": "var_standard",
      "quantity": 1,
      "delivery_instructions": "Discord: shoppex"
    }
  ]
}
'
{
  "data": {
    "id": "ord_123",
    "uniqid": "11111111-1111-4111-8111-111111111111",
    "shop_id": "shop_1",
    "customer_id": "cus_1",
    "affiliate_link_id": "link_1",
    "affiliate_customer_id": "cus_aff_1",
    "affiliate_code": "creator123",
    "affiliate_discount_amount": 3,
    "customer_email": "[email protected]",
    "currency": "USD",
    "status": "PENDING",
    "status_details": null,
    "payment_status": "PENDING",
    "gateway": "STRIPE",
    "flow_type": "CHECKOUT",
    "provider_reference": null,
    "provider_reference_type": null,
    "subtotal": 29.99,
    "discount": 3,
    "discount_display": 3,
    "tax": 0,
    "tax_percentage": 0,
    "total": 26.99,
    "total_display": 26.99,
    "balance_paid_amount": 0,
    "coupon_id": "coupon_spring10",
    "subscription_id": null,
    "custom_fields": {
      "source": "affiliate",
      "campaign": "spring_launch"
    },
    "is_developer_invoice": false,
    "developer_title": null,
    "checkout_url": "https://checkout.shoppex.io/invoice/11111111-1111-4111-8111-111111111111",
    "items": [
      {
        "product_id": "prod_starter",
        "product_title": "Starter Pack",
        "product_type": "DIGITAL",
        "variant_title": "Standard",
        "quantity": 1,
        "unit_price": 29.99,
        "total": 29.99,
        "delivery_instructions": "Discord: shoppex",
        "delivery_instructions_label": "Discord username",
        "delivered_items": {
          "access_url": "https://downloads.example.com/starter-pack"
        }
      }
    ],
    "created_at": 1711510800,
    "updated_at": 1711510860
  }
}

Authorizations

Authorization
string
header
required

Use your Shoppex API key in the Authorization header.

Body

items
object[]
required
email
string
customer_email
string
coupon_code
string | null
affiliate_code
string | null
affiliateCode
string | null
referral_code
string | null
referralCode
string | null
affiliate_id
string | null
affiliateId
string | null
gateway
string | null
title
string | null
custom_fields
object
customFields
object

Response

Successful response

data
object
required