POST
/
v2
/
orders
curl --request POST \
  --url https://api.loyaltylion.com/v2/orders \
  --header 'Content-Type: application/json' \
  --data '{
  "customer_id": "<string>",
  "customer_email": "<string>",
  "merchant_id": "<string>",
  "total": "<string>",
  "total_shipping": "<string>",
  "total_paid": "<string>",
  "payment_status": "not_paid",
  "merchant_number": "<string>",
  "discount_codes": [
    {
      "code": "<string>",
      "amount": "<string>"
    }
  ],
  "claimed_reward_ids": [
    123
  ],
  "date": "<string>",
  "ip_address": "<string>",
  "user_agent": "<string>",
  "referral_id": "<string>",
  "tracking_id": "<string>",
  "guest": true
}'
""

Add a new order to LoyaltyLion. This may trigger rules and award points to a customer. Merchants using a supported platform such as Shopify should usually not use this endpoint, as LoyaltyLion will retrieve orders from the platform via webhooks instead.

Query Parameters

site_id
number

Create the order in the specified site. This is only required for programs that have multiple sites. Programs with only a single site can omit this parameter, and the order will be created in the program's only site

Body

application/json
Body
customer_id
string
required

The ID of the customer in your platform or ecommerce store who placed the order

customer_email
string
required

The email address of the customer who placed the order

merchant_id
string
required

The ID of the order in your platform or ecommerce store

total
string
required

The total amount of order as a decimal string without formatting, e.g. 99.99

total_shipping
string
required

The total shipping amount for the order as a decimal string without formatting, e.g. 3.49

payment_status
enum<string>
required
Available options:
not_paid,
partially_paid,
paid
total_paid
string

The total amount paid for the order as a decimal string without formatting, e.g. 9.99

merchant_number
string

A optional order number to identify this order in your system

discount_codes
object[]
claimed_reward_ids
number[]

A list of LoyaltyLion claimed reward IDs that were used with this order

date
string

An ISO 8601 timestamp representing the date of the order. Defaults to now if not provided

ip_address
string

The IP address of the customer who placed the order. Used to track referrals

user_agent
string

The user agent of the customer who placed the order. Used to track referrals

referral_id
string

A LoyaltyLion referral ID, used to link this order to a referral

tracking_id
string

A LoyaltyLion tracking ID, used to link this order to a tracking source

guest
boolean

Whether this order was placed by a guest customer

Response

201
application/json
201

The response is of type enum<string>.

Available options: