Implementation
createOrders Mutation
This section covers the createOrders mutation — the request and response samples, all supported parameters, and code examples.
📋Before You Implement
- Submit a maximum of 10,000 orders per request. New orders cannot include more than 100 line items per order.
- Event times must not be set in the future.
- Processing can take up to an hour. Verify orders in the Commission Detail report or Commission Detail API once processing is complete.
- Replace all placeholder values with your actual data. Placeholders and example values are for illustration only and should not appear in your final request.
createOrders Parameters
Click any row to see type, format, and value examples.
Parameter
Description
Required
enterpriseIdYour CJ Enterprise ID. A static value provided by CJ and unique to your account.
Required
actionTrackerIdThe CJ Action Tracker ID that identifies which action this order should be attributed to. Provided by CJ — each account may have multiple action trackers.
Required
eventTimeThe date and time the order was placed. Must not be in the future.
Required
Type: StringFormat: ISO 8601 datetime in UTC
Examples
2024-01-15T18:08:36.089Z
Note: Orders with an eventTime in the future will fail field-level validation.
orderIdA unique identifier for the order in your system, such as an order number or invoice ID. Used to reconcile orders between your system and CJ.
Required
Type: StringFormat: Alphanumeric, dashes, and underscores only
Examples
ORD-2024-001234
INV_987654
Note: A unique order is defined by the combination of Order ID + Action ID + Enterprise ID. Do not include PII such as email addresses.
cjEventThe CJ Event ID used to attribute the order to the correct publisher. This is the primary attribution signal — use this whenever available.
Required
Type: String
Examples
7166ddf3b35b11eb834200a10a1eb972
Note: Read this value from the cje cookie stored on your site. If cjEvent, AID, and PID are all provided, cjEvent takes precedence. If none are provided, the order will be accepted but will fail during processing.
amountThe order total in the currency specified. Do not include shipping or tax.
Recommended
Type: FloatFormat: Numeric, max 2 decimal places
Examples
89.97
124.50
Note: If a currency other than your functional currency is specified, CJ converts the amount automatically using current exchange rates.
currencyThree-letter ISO 4217 currency code for the order amount. Defaults to the advertiser's functional currency if omitted.
Recommended
Type: StringFormat: ISO 4217 three-letter code
Examples
USD
GBP
EUR
Note: If omitted, the transaction defaults to your account's functional currency.
discountTotal discount applied to the order as a whole. Use for cart-level promotions such as a percentage off the entire order.
Recommended
Type: FloatFormat: Numeric, max 2 decimal places
Examples
10.00
5.50
Note: For item-level discounts, use the discount field within each item in the items array instead.
couponThe coupon or voucher code applied to the transaction.
Recommended
Type: String
Examples
SAVE10
WELCOME20
Note: Omit this field if no coupon was applied.
itemsArray of line items in the order. Enables item-level attribution, Situational Commissioning, and advanced Insights reporting.
Recommended
Type: Array[OrderItemInput]
Note: Maximum 100 items per order. Each item must include sku, unitPrice, and quantity. See Item-Level Parameters below.
Item-Level Parameters
Click any row to see type, format, and value examples.
Parameter
Description
Required
skuThe product identifier for the individual item purchased, such as a SKU or product ID.
Required
Type: StringFormat: Alphanumeric, dashes, and underscores only
Examples
SKU-001
PROD_4521
Note: Maximum 100 characters. Spaces and special characters are not permitted. Maximum 100 items per order.
unitPriceThe price of a single unit of the item. Do not multiply by quantity.
Required
Type: FloatFormat: Numeric only — no currency symbols or commas
Examples
29.99
3.00
Note: Pass the price of one item regardless of quantity. For two items at 3.00 each, pass 3.00 — not 6.00.
quantityThe number of units purchased for this item.
Required
Type: IntegerFormat: Whole numbers only
Examples
1
3
Note: Decimal quantities are not supported. For example, quantity=1.0 is read as quantity=10.
discountDiscount applied to this specific item. Use for product-level promotions such as a sale price on an individual SKU.
Recommended
Type: FloatFormat: Numeric, max 2 decimal places
Examples
5.00
Note: The discount is divided evenly across all units. A 5.00 discount on 2 units at 10.00 each reduces each unit to 7.50, giving a subtotal of 15.00.
Attribution Parameters
When cjEvent is not available, you may optionally provide an Ad ID (AID) and Promotional Property ID (PID) for attribution. If cjEvent and AID/PID are all passed, cjEvent takes precedence and AID/PID are ignored.
Click any row to see type, format, and value examples.
Parameter
Description
Required
adIdLink ID that is passed in the click-through to your site.
Required
Type: Integer
Note: If none of cjEvent, aid, or pid are passed, the order will be accepted by the API but will fail during processing.
promotionalPropertyIdPromotional Property ID. Referring Publisher promotional Id value that is passed in the click-through to your site.
Required
Type: Integer
Note: Must be passed together with aid for fallback attribution.
sidShopper ID (alphanumeric value) required if passed on click-through. This value is supplied by the publisher and passed in the click-through URL.
Optional
Type: alphanumeric
Note: The format is a text string of no more than 64 characters and is case sensitive.
Example Requests
mutation {
createOrders(newOrders: [{
enterpriseId: 1234567,
actionTrackerId: 123456,
eventTime: "2026-01-18T11:00:00.000Z",
orderId: "ORD2026-001234",
cjEvent: "7166ddf3b35b11eb834200a10a1eb972",
amount: 89.97,
discount: 10.00,
coupon: "SAVE10",
currency: "USD",
verticalParameters: {
customerStatus: "New",
brand: "CJ",
loyaltyStatus: "Yes"
},
items: [
{ sku: "SKU-001", unitPrice: 29.99, quantity: 2, discount: 5.00 },
{ sku: "SKU-002", unitPrice: 15.50, quantity: 1, discount: 0.00 }
]
}]) {
orders { submissionId, orderReceivedTime, orderId, amount,
items { sku, unitPrice, quantity, discount }
}
errors { message, fields }
}
}mutation {
createOrders(newOrders: [{
enterpriseId: 1234567,
actionTrackerId: 123456,
eventTime: "2026-02-02T18:00:00.000Z",
orderId: "BOOKING-YN25890C",
cjEvent: "7166ddf3b35b11eb834200a10a1eb972",
amount: 603.94,
discount: 0,
currency: "USD",
verticalParameters: {
flightType: "round_trip",
iata: "LAX,SEA",
originCity: "Los Angeles",
originState: "CA",
destinationCity: "Seattle",
destinationState: "WA",
startDateTime: "2026-05-15T00:00:00.000Z",
endDateTime: "2026-05-15T10:00:00.000Z"
},
items: [
{ sku: "FLIGHT-001", unitPrice: 578.94, quantity: 1, discount: 0.00 },
{ sku: "SEAT-UPG", unitPrice: 25.00, quantity: 1, discount: 0.00 }
]
}]) {
orders { submissionId, orderId,
verticalParameters { flightType, iata, originCity, destinationCity, endDateTime }
}
errors { message, fields }
}
}mutation {
createOrders(newOrders: [{
enterpriseId: 1234567,
actionTrackerId: 123456,
eventTime: "2026-02-02T18:00:00.000Z",
orderId: "HT-2208",
cjEvent: "7166ddf3b35b11eb834200a10a1eb972",
amount: 347.29,
discount: 0,
currency: "USD",
verticalParameters: {
guests: "3",
roomType: "standard",
rooms: "1",
brand: "hotel-name",
startDateTime: "2026-06-02T00:00:00.000Z",
endDateTime: "2026-06-10T00:00:00.000Z"
},
items: [
{ sku: "HOTEL-001", unitPrice: 347.29, quantity: 1, discount: 0.00 }
]
}]) {
orders { submissionId, orderId, amount,
verticalParameters { brand, endDateTime }
}
errors { message, fields }
}
}mutation {
createOrders(newOrders: [{
enterpriseId: 1234567,
actionTrackerId: 123456,
eventTime: "2026-03-15T18:00:00.000Z",
orderId: "CHK00482231",
cjEvent: "7166ddf3b35b11eb834200a10a1eb972",
amount: 0,
currency: "USD"
verticalParameters: {
applicationStatus: "approved",
fundedAmount: 2000,
}
}]) {
orders { submissionId, orderId }
errors { message, fields }
}
}mutation {
createOrders(newOrders: [{
enterpriseId: 1234567,
actionTrackerId: 123456,
eventTime: "2026-01-18T11:00:00.000Z",
orderId: "23992123",
cjEvent: "7166ddf3b35b11eb834200a10a1eb972",
amount: 89.98,
discount: 10.00,
currency: "USD",
verticalParameters: {
annualFee: 9.99,
contractLength: 12,
contractType: "fios"
},
items: [
{ sku: "internet-fios", unitPrice: 59.99, quantity: 1, discount: 0 },
{ sku: "tv-bundle", unitPrice: 29.99, quantity: 1, discount: 0 }
]
}]) {
orders { submissionId, orderId, amount, cjEvent, currency
items { sku, unitPrice, quantity, discount }
}
errors { message, fields }
}
}Example Responses
{
"data": {
"createOrders": {
"orders": [
{
"submissionId": "7c2a7e50-92a4-11ea-bb37-0242ac130002",
"orderReceivedTime": "2026-01-18T11:02:00.000Z",
"orderId": "ORD2024-001234",
"amount": 89.97,
"items": [
{ "sku": "SKU-001", "unitPrice": 29.99, "quantity": 2, "discount": 5.00 },
{ "sku": "SKU-002", "unitPrice": 15.50, "quantity": 1, "discount": 0 }
]
}
],
"errors": null
}
}
}{
"data": {
"createOrders": {
"orders": [
{
"submissionId": "19fdbe99-9220-11ea-8141-00000a00011b",
"orderId": "BOOKING-YN25890C",
"verticalParameters": {
"flightType": "round_trip",
"iata": "LAX,SEA",
"originCity": "Los Angeles",
"destinationCity": "Seattle",
"endDateTime": "2026-05-15T10:00:00.000Z"
}
}
],
"errors": null
}
}
}{
"data": {
"createOrders": {
"orders": [
{
"submissionId": "ab3d0d38-339f-11f1-92fa-99dbecce353f",
"orderId": "HT-2208",
"amount": 347.29,
"verticalParameters": {
"brand": "hotel-name",
"endDateTime: "2026-06-10T00:00:00.000Z"
}
}
],
"errors": null
}
}
}{
"data": {
"createOrders": {
"orders": [
{
"submissionId": "4f8e3120-c651-11ee-864c-00155d011f08",
"orderId": "CHK00482231"
}
],
"errors": null
}
}
}{
"data": {
"createOrders": {
"orders": [
{
"submissionId": "b27a6c40-153b-11ef-92e1-325096b39f47",
"orderId": "23992123",
"amount": 89.98,
"cjEvent": "7166ddf3b35b11eb834200a10a1eb972",
"currency": "USD",
"items": [
{ sku: "internet-fios", unitPrice: 59.99, quantity: 1, discount: 0 },
{ sku: "tv-bundle", unitPrice: 29.99, quantity: 1, discount: 0 }
]
}
],
"errors": null
}
}
}Updated 11 days ago
What’s Next
