Skip to main content
POST
/
v2
/
order_events
Create order events
curl --request POST \
  --url https://dev.sbx.imprint.co/v2/order_events \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "order_id": "77f60af4-185e-4867-b113-34e3cf7c6acd",
  "type": "CAPTURED",
  "amount": 274999,
  "network_transaction_id": "615e3ba0-6b99-495b-ade4-1f584c40f376",
  "order_event_id": "77f60af4-185e-4867-b113-34e3cf7c6acd",
  "partner_event_id": "7622c07d-eb2b-4345-a9a9-345d61d32bc2",
  "rewards_amount": 2500,
  "currency": "USD",
  "order_lines": [
    {
      "name": "Couch Supreme",
      "product_url": "www.restassured.com/couch-supreme",
      "quantity": 1,
      "rate": 274999,
      "rewards_rate": 2500
    }
  ]
}
'
{
  "order_id": "77f60af4-185e-4867-b113-34e3cf7c6acd",
  "type": "CAPTURED",
  "amount": 274999,
  "network_transaction_id": "615e3ba0-6b99-495b-ade4-1f584c40f376",
  "order_event_id": "77f60af4-185e-4867-b113-34e3cf7c6acd",
  "partner_event_id": "7622c07d-eb2b-4345-a9a9-345d61d32bc2",
  "rewards_amount": 2500,
  "currency": "USD",
  "order_lines": [
    {
      "name": "Couch Supreme",
      "product_url": "www.restassured.com/couch-supreme",
      "quantity": 1,
      "rate": 274999,
      "rewards_rate": 2500
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>

Body

application/json
order_id
string
required

The ID of the order to which the event is related

Example:

"77f60af4-185e-4867-b113-34e3cf7c6acd"

type
enum<string>
required

Type of order event

Available options:
CAPTURED,
REFUNDED
Example:

"CAPTURED"

amount
number<iso-4217>
required

Total event amount ($2,699.99 + $50.00)

Example:

274999

network_transaction_id
string
required

Card network transaction identifier

Example:

"615e3ba0-6b99-495b-ade4-1f584c40f376"

order_event_id
string

The ID of the order event

Example:

"77f60af4-185e-4867-b113-34e3cf7c6acd"

partner_event_id
string

Partner's event identifier

Example:

"7622c07d-eb2b-4345-a9a9-345d61d32bc2"

rewards_amount
number<iso-4217>

Total rewards amount for the event ($25 + $0)

Example:

2500

currency
string

The 3-character currency code of the amount in ISO 4217 format (e.g., "USD")

Example:

"USD"

order_lines
object[]

When provided, the API will require that the calculated sum of all the rates and rewards rates within (taking quantities into account) are equal to the amount and rewards_amount, respectively. It is important to note that the sums of all event amounts and event rewards amounts belonging to an order do not need to be equal to total_order_amount and total_rewards_amount in the order, as the data contained in events will serve as the final source of truth for the lifecycle of the order, as it actually transpired.

Example:
[
  {
    "name": "Couch Supreme",
    "product_url": "www.restassured.com/couch-supreme",
    "quantity": 1,
    "rate": 274999,
    "rewards_rate": 2500
  }
]

Response

200 - application/json

Order event created successfully

order_id
string
required

The ID of the order to which the event is related

Example:

"77f60af4-185e-4867-b113-34e3cf7c6acd"

type
enum<string>
required

Type of order event

Available options:
CAPTURED,
REFUNDED
Example:

"CAPTURED"

amount
number<iso-4217>
required

Total event amount ($2,699.99 + $50.00)

Example:

274999

network_transaction_id
string
required

Card network transaction identifier

Example:

"615e3ba0-6b99-495b-ade4-1f584c40f376"

order_event_id
string

The ID of the order event

Example:

"77f60af4-185e-4867-b113-34e3cf7c6acd"

partner_event_id
string

Partner's event identifier

Example:

"7622c07d-eb2b-4345-a9a9-345d61d32bc2"

rewards_amount
number<iso-4217>

Total rewards amount for the event ($25 + $0)

Example:

2500

currency
string

The 3-character currency code of the amount in ISO 4217 format (e.g., "USD")

Example:

"USD"

order_lines
object[]

When provided, the API will require that the calculated sum of all the rates and rewards rates within (taking quantities into account) are equal to the amount and rewards_amount, respectively. It is important to note that the sums of all event amounts and event rewards amounts belonging to an order do not need to be equal to total_order_amount and total_rewards_amount in the order, as the data contained in events will serve as the final source of truth for the lifecycle of the order, as it actually transpired.

Example:
[
  {
    "name": "Couch Supreme",
    "product_url": "www.restassured.com/couch-supreme",
    "quantity": 1,
    "rate": 274999,
    "rewards_rate": 2500
  }
]