Skip to content

Onward API (1.0.0)

Download OpenAPI description
Languages
Servers
https://app.useonward.com/api/v1/

Orders

Your customers orders, including the information necessary for Onward to insure and handle claims.

Operations

Create an order

Request

When a customer places an order in your e-comm platform, create that order with its details in Onward.

Security
api_key
Headers
Content-Typestringrequired

Content-Type must be application/json

Example: application/json
Acceptstringrequired

Accept must be application/json

Example: application/json
Bodyapplication/jsonrequired
shop_order_idstringrequired

Your ID for the Order

Example: "18282"
shop_order_numberstringrequired

The Order Number as presented to the customer

Example: "W-94713"
subtotal_priceanyrequired

Order subtotal in shop's currency

Example: {"cents":1999,"currency":"USD"}
subtotal_price_presentmentany

Order subtotal in customer's currency

Example: {"cents":1999,"currency":"USD"}
total_discounts_priceanyrequired

Sum of applied discounts in shop's currency

Example: {"cents":599,"currency":"USD"}
total_discounts_price_presentmentany

Sum of applied discounts in customer's currency

Example: {"cents":599,"currency":"USD"}
total_shipping_priceanyrequired

Shipping amount in shop's currency

Example: {"cents":299,"currency":"USD"}
total_shipping_price_presentmentany

Shipping amount in customer's currency

Example: {"cents":299,"currency":"USD"}
total_tax_priceanyrequired

Total tax in shop's currency

Example: {"cents":143,"currency":"USD"}
total_tax_price_presentmentany

Total tax in customer's currency

Example: {"cents":143,"currency":"USD"}
total_priceanyrequired

Order total in shop's currency

Example: {"cents":2499,"currency":"USD"}
total_price_presentmentany

Order total in customer's currency

Example: {"cents":2499,"currency":"USD"}
amount_insuredany

Sum of shippable line items that are being insured in shop's currency

Example: {"cents":1200,"currency":"USD"}
amount_insured_presentmentany

Sum of shippable line items that are being insured in customer's currency

Example: {"cents":1200,"currency":"USD"}
purchased_quote_tokenstring

The quote being purchased, as received from Onward's Quote API

Example: "c0740f7e3d4718a64fd9ce18101961d210d1c61c8c8afd62f95d62d8c433347b$$qkJClv/+sWfpOfPqp4sI46PxzBuBCW4eEDKsL4q87aFhRT9mdCpIuEWwuRuvbkX4BS8=--AUnUz8WgunyUiZ4o--nnYz0Lj5WsxSqsUxtBpIIQ=="
created_atstring(date-time)required

When the order was placed in your e-comm platform

Example: "2024-11-26T17:32:28Z"
financial_statusstringrequired
Enum"pending""paid""refunded""voided"
Example: "paid"
customerobject(Customer)required
customer.​shop_customer_idstringrequired

Your ID for the Customer

Example: "7461"
customer.​first_namestringrequired
Example: "Sally"
customer.​last_namestringrequired
Example: "Loo"
customer.​emailstring(email)
Example: "sally@example.com"
customer.​phone_numberstring(phone)
Example: "+13105551234"
shipping_addressobject(Address)required
shipping_address.​address1stringrequired
Example: "123 Main St"
shipping_address.​address2string
Example: "Unit 50"
shipping_address.​province_codestringrequired

Subdivision code (ISO-3166)

Example: "CA"
shipping_address.​citystringrequired
Example: "Los Angeles"
shipping_address.​postal_codestringrequired
Example: "90210"
shipping_address.​country_codestringrequired

Alpha-2 country code (ISO-3166)

Example: "US"
shipping_address.​phone_numberstring(phone)required
Example: "+13105551234"
line_itemsArray of objects(LineItem)required
line_items[].​shop_line_item_idstringrequired

Your ID for the Line Item

Example: "816721"
line_items[].​shop_product_idstringrequired

Your ID for the product

Example: "142"
line_items[].​shop_variant_idstringrequired

Your ID or SKU for the variant

Example: "7261"
line_items[].​namestringrequired

Name for the product and variant purchased

Example: "Cool T-shirt - Red"
line_items[].​unit_priceanyrequired

Item price in order's currency

Example: {"cents":500,"currency":"USD"}
line_items[].​total_priceanyrequired

Line item total in order's currency

Example: {"cents":1000,"currency":"USD"}
line_items[].​total_price_presentmentany

Line item total in customer's currency

Example: {"cents":1000,"currency":"USD"}
line_items[].​quantityinteger(int32)required
Example: 2
line_items[].​image_urlstring(url)required

URL to an image of the item

Example: "https://placecats.com/neo/300/200.png"
line_items[].​gramsinteger(int32)required

Weight of the item in grams

Example: 24
line_items[].​is_insuredbooleanrequired

Whether the item should be insured by Onward (generally you should set this to true for shippable items and false for digital items). Requires purchase token and amount insured in the Order.

Example: true
line_items[].​refunded_quantityinteger(int32)

Number of items refunded (for full or partial refunds)

Example: 1
line_items[].​refunded_priceany

Total refunded amount in order's currency

Example: {"cents":500,"currency":"USD"}
line_items[].​refunded_price_presentmentany

Total refunded amount in customer's currency

Example: {"cents":500,"currency":"USD"}
curl -i -X POST \
  https://app.useonward.com/api/v1/orders \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY_HERE' \
  -d '{
    "shop_order_id": "18282",
    "shop_order_number": "W-94713",
    "subtotal_price": {
      "cents": 1999,
      "currency": "USD"
    },
    "subtotal_price_presentment": {
      "cents": 1999,
      "currency": "USD"
    },
    "total_discounts_price": {
      "cents": 599,
      "currency": "USD"
    },
    "total_discounts_price_presentment": {
      "cents": 599,
      "currency": "USD"
    },
    "total_shipping_price": {
      "cents": 299,
      "currency": "USD"
    },
    "total_shipping_price_presentment": {
      "cents": 299,
      "currency": "USD"
    },
    "total_tax_price": {
      "cents": 143,
      "currency": "USD"
    },
    "total_tax_price_presentment": {
      "cents": 143,
      "currency": "USD"
    },
    "total_price": {
      "cents": 2499,
      "currency": "USD"
    },
    "total_price_presentment": {
      "cents": 2499,
      "currency": "USD"
    },
    "amount_insured": {
      "cents": 1200,
      "currency": "USD"
    },
    "amount_insured_presentment": {
      "cents": 1200,
      "currency": "USD"
    },
    "purchased_quote_token": "c0740f7e3d4718a64fd9ce18101961d210d1c61c8c8afd62f95d62d8c433347b$$qkJClv/+sWfpOfPqp4sI46PxzBuBCW4eEDKsL4q87aFhRT9mdCpIuEWwuRuvbkX4BS8=--AUnUz8WgunyUiZ4o--nnYz0Lj5WsxSqsUxtBpIIQ==",
    "created_at": "2024-11-26T17:32:28Z",
    "financial_status": "paid",
    "customer": {
      "shop_customer_id": "7461",
      "first_name": "Sally",
      "last_name": "Loo",
      "email": "sally@example.com",
      "phone_number": "+13105551234"
    },
    "shipping_address": {
      "address1": "123 Main St",
      "address2": "Unit 50",
      "province_code": "CA",
      "city": "Los Angeles",
      "postal_code": "90210",
      "country_code": "US",
      "phone_number": "+13105551234"
    },
    "line_items": [
      {
        "shop_line_item_id": "816721",
        "shop_product_id": "142",
        "shop_variant_id": "7261",
        "name": "Cool T-shirt - Red",
        "unit_price": {
          "cents": 500,
          "currency": "USD"
        },
        "total_price": {
          "cents": 1000,
          "currency": "USD"
        },
        "total_price_presentment": {
          "cents": 1000,
          "currency": "USD"
        },
        "quantity": 2,
        "image_url": "https://placecats.com/neo/300/200.png",
        "grams": 24,
        "is_insured": true,
        "refunded_quantity": 1,
        "refunded_price": {
          "cents": 500,
          "currency": "USD"
        },
        "refunded_price_presentment": {
          "cents": 500,
          "currency": "USD"
        }
      }
    ]
  }'

Responses

Order created successfully

Bodyapplication/json
shop_order_idstringrequired

Your ID for the Order

Example: "18282"
shop_order_numberstringrequired

The Order Number as presented to the customer

Example: "W-94713"
subtotal_priceanyrequired

Order subtotal in shop's currency

Example: {"cents":1999,"currency":"USD"}
subtotal_price_presentmentany

Order subtotal in customer's currency

Example: {"cents":1999,"currency":"USD"}
total_discounts_priceanyrequired

Sum of applied discounts in shop's currency

Example: {"cents":599,"currency":"USD"}
total_discounts_price_presentmentany

Sum of applied discounts in customer's currency

Example: {"cents":599,"currency":"USD"}
total_shipping_priceanyrequired

Shipping amount in shop's currency

Example: {"cents":299,"currency":"USD"}
total_shipping_price_presentmentany

Shipping amount in customer's currency

Example: {"cents":299,"currency":"USD"}
total_tax_priceanyrequired

Total tax in shop's currency

Example: {"cents":143,"currency":"USD"}
total_tax_price_presentmentany

Total tax in customer's currency

Example: {"cents":143,"currency":"USD"}
total_priceanyrequired

Order total in shop's currency

Example: {"cents":2499,"currency":"USD"}
total_price_presentmentany

Order total in customer's currency

Example: {"cents":2499,"currency":"USD"}
insurance_paidany

Insurance paid for this order by the customer

Example: {"cents":2499,"currency":"USD"}
amount_insuredany

Sum of shippable line items that are being insured in shop's currency

Example: {"cents":1200,"currency":"USD"}
amount_insured_presentmentany

Sum of shippable line items that are being insured in customer's currency

Example: {"cents":1200,"currency":"USD"}
created_atstring(date-time)required

When the order was placed in your e-comm platform

Example: "2024-11-26T17:32:28Z"
financial_statusstringrequired
Enum"pending""paid""refunded""voided"
Example: "paid"
customerobject(Customer)required
customer.​shop_customer_idstringrequired

Your ID for the Customer

Example: "7461"
customer.​first_namestringrequired
Example: "Sally"
customer.​last_namestringrequired
Example: "Loo"
customer.​emailstring(email)
Example: "sally@example.com"
customer.​phone_numberstring(phone)
Example: "+13105551234"
shipping_addressobject(Address)required
shipping_address.​address1stringrequired
Example: "123 Main St"
shipping_address.​address2string
Example: "Unit 50"
shipping_address.​province_codestringrequired

Subdivision code (ISO-3166)

Example: "CA"
shipping_address.​citystringrequired
Example: "Los Angeles"
shipping_address.​postal_codestringrequired
Example: "90210"
shipping_address.​country_codestringrequired

Alpha-2 country code (ISO-3166)

Example: "US"
shipping_address.​phone_numberstring(phone)required
Example: "+13105551234"
line_itemsArray of objects(LineItem)required
line_items[].​shop_line_item_idstringrequired

Your ID for the Line Item

Example: "816721"
line_items[].​shop_product_idstringrequired

Your ID for the product

Example: "142"
line_items[].​shop_variant_idstringrequired

Your ID or SKU for the variant

Example: "7261"
line_items[].​namestringrequired

Name for the product and variant purchased

Example: "Cool T-shirt - Red"
line_items[].​unit_priceanyrequired

Item price in order's currency

Example: {"cents":500,"currency":"USD"}
line_items[].​total_priceanyrequired

Line item total in order's currency

Example: {"cents":1000,"currency":"USD"}
line_items[].​total_price_presentmentany

Line item total in customer's currency

Example: {"cents":1000,"currency":"USD"}
line_items[].​quantityinteger(int32)required
Example: 2
line_items[].​image_urlstring(url)required

URL to an image of the item

Example: "https://placecats.com/neo/300/200.png"
line_items[].​gramsinteger(int32)required

Weight of the item in grams

Example: 24
line_items[].​is_insuredbooleanrequired

Whether the item should be insured by Onward (generally you should set this to true for shippable items and false for digital items). Requires purchase token and amount insured in the Order.

Example: true
line_items[].​refunded_quantityinteger(int32)

Number of items refunded (for full or partial refunds)

Example: 1
line_items[].​refunded_priceany

Total refunded amount in order's currency

Example: {"cents":500,"currency":"USD"}
line_items[].​refunded_price_presentmentany

Total refunded amount in customer's currency

Example: {"cents":500,"currency":"USD"}
Response
application/json
{ "shop_order_id": "18282", "shop_order_number": "W-94713", "subtotal_price": { "cents": 1999, "currency": "USD" }, "subtotal_price_presentment": { "cents": 1999, "currency": "USD" }, "total_discounts_price": { "cents": 599, "currency": "USD" }, "total_discounts_price_presentment": { "cents": 599, "currency": "USD" }, "total_shipping_price": { "cents": 299, "currency": "USD" }, "total_shipping_price_presentment": { "cents": 299, "currency": "USD" }, "total_tax_price": { "cents": 143, "currency": "USD" }, "total_tax_price_presentment": { "cents": 143, "currency": "USD" }, "total_price": { "cents": 2499, "currency": "USD" }, "total_price_presentment": { "cents": 2499, "currency": "USD" }, "insurance_paid": { "cents": 2499, "currency": "USD" }, "amount_insured": { "cents": 1200, "currency": "USD" }, "amount_insured_presentment": { "cents": 1200, "currency": "USD" }, "created_at": "2024-11-26T17:32:28Z", "financial_status": "paid", "customer": { "shop_customer_id": "7461", "first_name": "Sally", "last_name": "Loo", "email": "sally@example.com", "phone_number": "+13105551234" }, "shipping_address": { "address1": "123 Main St", "address2": "Unit 50", "province_code": "CA", "city": "Los Angeles", "postal_code": "90210", "country_code": "US", "phone_number": "+13105551234" }, "line_items": [ {} ] }

Update an order

Request

When order details change in your e-comm platform, update the order in Onward.

Security
api_key
Path
shopOrderIdstringrequired

Your ID for the Order

Headers
Content-Typestringrequired

Content-Type must be application/json

Example: application/json
Acceptstringrequired

Accept must be application/json

Example: application/json
Bodyapplication/jsonrequired
shop_order_numberstringrequired

The Order Number as presented to the customer

Example: "W-94713"
subtotal_priceanyrequired

Order subtotal in customer's currency

Example: {"cents":1999,"currency":"USD"}
total_discounts_priceanyrequired

Sum of applied discounts in customer's currency

Example: {"cents":599,"currency":"USD"}
total_shipping_priceanyrequired

Shipping amount in customer's currency

Example: {"cents":299,"currency":"USD"}
total_tax_priceanyrequired

Total tax in customer's currency

Example: {"cents":143,"currency":"USD"}
total_priceanyrequired

Order total in customer's currency

Example: {"cents":2499,"currency":"USD"}
financial_statusstringrequired
Enum"pending""paid""refunded""voided"
Example: "paid"
customerobject(Customer)required
customer.​shop_customer_idstringrequired

Your ID for the Customer

Example: "7461"
customer.​first_namestringrequired
Example: "Sally"
customer.​last_namestringrequired
Example: "Loo"
customer.​emailstring(email)
Example: "sally@example.com"
customer.​phone_numberstring(phone)
Example: "+13105551234"
shipping_addressobject(Address)required
shipping_address.​address1stringrequired
Example: "123 Main St"
shipping_address.​address2string
Example: "Unit 50"
shipping_address.​province_codestringrequired

Subdivision code (ISO-3166)

Example: "CA"
shipping_address.​citystringrequired
Example: "Los Angeles"
shipping_address.​postal_codestringrequired
Example: "90210"
shipping_address.​country_codestringrequired

Alpha-2 country code (ISO-3166)

Example: "US"
shipping_address.​phone_numberstring(phone)required
Example: "+13105551234"
line_itemsArray of objects(LineItem)required
line_items[].​shop_line_item_idstringrequired

Your ID for the Line Item

Example: "816721"
line_items[].​shop_product_idstringrequired

Your ID for the product

Example: "142"
line_items[].​shop_variant_idstringrequired

Your ID or SKU for the variant

Example: "7261"
line_items[].​namestringrequired

Name for the product and variant purchased

Example: "Cool T-shirt - Red"
line_items[].​unit_priceanyrequired

Item price in order's currency

Example: {"cents":500,"currency":"USD"}
line_items[].​total_priceanyrequired

Line item total in order's currency

Example: {"cents":1000,"currency":"USD"}
line_items[].​total_price_presentmentany

Line item total in customer's currency

Example: {"cents":1000,"currency":"USD"}
line_items[].​quantityinteger(int32)required
Example: 2
line_items[].​image_urlstring(url)required

URL to an image of the item

Example: "https://placecats.com/neo/300/200.png"
line_items[].​gramsinteger(int32)required

Weight of the item in grams

Example: 24
line_items[].​is_insuredbooleanrequired

Whether the item should be insured by Onward (generally you should set this to true for shippable items and false for digital items). Requires purchase token and amount insured in the Order.

Example: true
line_items[].​refunded_quantityinteger(int32)

Number of items refunded (for full or partial refunds)

Example: 1
line_items[].​refunded_priceany

Total refunded amount in order's currency

Example: {"cents":500,"currency":"USD"}
line_items[].​refunded_price_presentmentany

Total refunded amount in customer's currency

Example: {"cents":500,"currency":"USD"}
curl -i -X PATCH \
  'https://app.useonward.com/api/v1/orders/{shopOrderId}' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY_HERE' \
  -d '{
    "shop_order_number": "W-94713",
    "subtotal_price": {
      "cents": 1999,
      "currency": "USD"
    },
    "total_discounts_price": {
      "cents": 599,
      "currency": "USD"
    },
    "total_shipping_price": {
      "cents": 299,
      "currency": "USD"
    },
    "total_tax_price": {
      "cents": 143,
      "currency": "USD"
    },
    "total_price": {
      "cents": 2499,
      "currency": "USD"
    },
    "financial_status": "paid",
    "customer": {
      "shop_customer_id": "7461",
      "first_name": "Sally",
      "last_name": "Loo",
      "email": "sally@example.com",
      "phone_number": "+13105551234"
    },
    "shipping_address": {
      "address1": "123 Main St",
      "address2": "Unit 50",
      "province_code": "CA",
      "city": "Los Angeles",
      "postal_code": "90210",
      "country_code": "US",
      "phone_number": "+13105551234"
    },
    "line_items": [
      {
        "shop_line_item_id": "816721",
        "shop_product_id": "142",
        "shop_variant_id": "7261",
        "name": "Cool T-shirt - Red",
        "unit_price": {
          "cents": 500,
          "currency": "USD"
        },
        "total_price": {
          "cents": 1000,
          "currency": "USD"
        },
        "total_price_presentment": {
          "cents": 1000,
          "currency": "USD"
        },
        "quantity": 2,
        "image_url": "https://placecats.com/neo/300/200.png",
        "grams": 24,
        "is_insured": true,
        "refunded_quantity": 1,
        "refunded_price": {
          "cents": 500,
          "currency": "USD"
        },
        "refunded_price_presentment": {
          "cents": 500,
          "currency": "USD"
        }
      }
    ]
  }'

Responses

Order updated successfully

Body
shop_order_idstringrequired

Your ID for the Order

Example: "18282"
shop_order_numberstringrequired

The Order Number as presented to the customer

Example: "W-94713"
subtotal_priceanyrequired

Order subtotal in shop's currency

Example: {"cents":1999,"currency":"USD"}
subtotal_price_presentmentany

Order subtotal in customer's currency

Example: {"cents":1999,"currency":"USD"}
total_discounts_priceanyrequired

Sum of applied discounts in shop's currency

Example: {"cents":599,"currency":"USD"}
total_discounts_price_presentmentany

Sum of applied discounts in customer's currency

Example: {"cents":599,"currency":"USD"}
total_shipping_priceanyrequired

Shipping amount in shop's currency

Example: {"cents":299,"currency":"USD"}
total_shipping_price_presentmentany

Shipping amount in customer's currency

Example: {"cents":299,"currency":"USD"}
total_tax_priceanyrequired

Total tax in shop's currency

Example: {"cents":143,"currency":"USD"}
total_tax_price_presentmentany

Total tax in customer's currency

Example: {"cents":143,"currency":"USD"}
total_priceanyrequired

Order total in shop's currency

Example: {"cents":2499,"currency":"USD"}
total_price_presentmentany

Order total in customer's currency

Example: {"cents":2499,"currency":"USD"}
insurance_paidany

Insurance paid for this order by the customer

Example: {"cents":2499,"currency":"USD"}
amount_insuredany

Sum of shippable line items that are being insured in shop's currency

Example: {"cents":1200,"currency":"USD"}
amount_insured_presentmentany

Sum of shippable line items that are being insured in customer's currency

Example: {"cents":1200,"currency":"USD"}
created_atstring(date-time)required

When the order was placed in your e-comm platform

Example: "2024-11-26T17:32:28Z"
financial_statusstringrequired
Enum"pending""paid""refunded""voided"
Example: "paid"
customerobject(Customer)required
customer.​shop_customer_idstringrequired

Your ID for the Customer

Example: "7461"
customer.​first_namestringrequired
Example: "Sally"
customer.​last_namestringrequired
Example: "Loo"
customer.​emailstring(email)
Example: "sally@example.com"
customer.​phone_numberstring(phone)
Example: "+13105551234"
shipping_addressobject(Address)required
shipping_address.​address1stringrequired
Example: "123 Main St"
shipping_address.​address2string
Example: "Unit 50"
shipping_address.​province_codestringrequired

Subdivision code (ISO-3166)

Example: "CA"
shipping_address.​citystringrequired
Example: "Los Angeles"
shipping_address.​postal_codestringrequired
Example: "90210"
shipping_address.​country_codestringrequired

Alpha-2 country code (ISO-3166)

Example: "US"
shipping_address.​phone_numberstring(phone)required
Example: "+13105551234"
line_itemsArray of objects(LineItem)required
line_items[].​shop_line_item_idstringrequired

Your ID for the Line Item

Example: "816721"
line_items[].​shop_product_idstringrequired

Your ID for the product

Example: "142"
line_items[].​shop_variant_idstringrequired

Your ID or SKU for the variant

Example: "7261"
line_items[].​namestringrequired

Name for the product and variant purchased

Example: "Cool T-shirt - Red"
line_items[].​unit_priceanyrequired

Item price in order's currency

Example: {"cents":500,"currency":"USD"}
line_items[].​total_priceanyrequired

Line item total in order's currency

Example: {"cents":1000,"currency":"USD"}
line_items[].​total_price_presentmentany

Line item total in customer's currency

Example: {"cents":1000,"currency":"USD"}
line_items[].​quantityinteger(int32)required
Example: 2
line_items[].​image_urlstring(url)required

URL to an image of the item

Example: "https://placecats.com/neo/300/200.png"
line_items[].​gramsinteger(int32)required

Weight of the item in grams

Example: 24
line_items[].​is_insuredbooleanrequired

Whether the item should be insured by Onward (generally you should set this to true for shippable items and false for digital items). Requires purchase token and amount insured in the Order.

Example: true
line_items[].​refunded_quantityinteger(int32)

Number of items refunded (for full or partial refunds)

Example: 1
line_items[].​refunded_priceany

Total refunded amount in order's currency

Example: {"cents":500,"currency":"USD"}
line_items[].​refunded_price_presentmentany

Total refunded amount in customer's currency

Example: {"cents":500,"currency":"USD"}
Response
{ "shop_order_id": "18282", "shop_order_number": "W-94713", "subtotal_price": { "cents": 1999, "currency": "USD" }, "subtotal_price_presentment": { "cents": 1999, "currency": "USD" }, "total_discounts_price": { "cents": 599, "currency": "USD" }, "total_discounts_price_presentment": { "cents": 599, "currency": "USD" }, "total_shipping_price": { "cents": 299, "currency": "USD" }, "total_shipping_price_presentment": { "cents": 299, "currency": "USD" }, "total_tax_price": { "cents": 143, "currency": "USD" }, "total_tax_price_presentment": { "cents": 143, "currency": "USD" }, "total_price": { "cents": 2499, "currency": "USD" }, "total_price_presentment": { "cents": 2499, "currency": "USD" }, "insurance_paid": { "cents": 2499, "currency": "USD" }, "amount_insured": { "cents": 1200, "currency": "USD" }, "amount_insured_presentment": { "cents": 1200, "currency": "USD" }, "created_at": "2024-11-26T17:32:28Z", "financial_status": "paid", "customer": { "shop_customer_id": "7461", "first_name": "Sally", "last_name": "Loo", "email": "sally@example.com", "phone_number": "+13105551234" }, "shipping_address": { "address1": "123 Main St", "address2": "Unit 50", "province_code": "CA", "city": "Los Angeles", "postal_code": "90210", "country_code": "US", "phone_number": "+13105551234" }, "line_items": [ {} ] }

Mark an order's insurance as refunded

Request

When you refund the patient for the insurnace amount in your e-comm platform, update the order's insurance status in Onward.

Security
api_key
Path
shopOrderIdstringrequired

Your ID for the Order

Headers
Content-Typestringrequired

Content-Type must be application/json

Example: application/json
Acceptstringrequired

Accept must be application/json

Example: application/json
curl -i -X PATCH \
  'https://app.useonward.com/api/v1/orders/{shopOrderId}/refund_insurance' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY_HERE'

Responses

Insurance refunded successfully

Bodyapplication/json
shop_order_idstringrequired

Your ID for the Order

Example: "18282"
shop_order_numberstringrequired

The Order Number as presented to the customer

Example: "W-94713"
subtotal_priceanyrequired

Order subtotal in shop's currency

Example: {"cents":1999,"currency":"USD"}
subtotal_price_presentmentany

Order subtotal in customer's currency

Example: {"cents":1999,"currency":"USD"}
total_discounts_priceanyrequired

Sum of applied discounts in shop's currency

Example: {"cents":599,"currency":"USD"}
total_discounts_price_presentmentany

Sum of applied discounts in customer's currency

Example: {"cents":599,"currency":"USD"}
total_shipping_priceanyrequired

Shipping amount in shop's currency

Example: {"cents":299,"currency":"USD"}
total_shipping_price_presentmentany

Shipping amount in customer's currency

Example: {"cents":299,"currency":"USD"}
total_tax_priceanyrequired

Total tax in shop's currency

Example: {"cents":143,"currency":"USD"}
total_tax_price_presentmentany

Total tax in customer's currency

Example: {"cents":143,"currency":"USD"}
total_priceanyrequired

Order total in shop's currency

Example: {"cents":2499,"currency":"USD"}
total_price_presentmentany

Order total in customer's currency

Example: {"cents":2499,"currency":"USD"}
insurance_paidany

Insurance paid for this order by the customer

Example: {"cents":2499,"currency":"USD"}
amount_insuredany

Sum of shippable line items that are being insured in shop's currency

Example: {"cents":1200,"currency":"USD"}
amount_insured_presentmentany

Sum of shippable line items that are being insured in customer's currency

Example: {"cents":1200,"currency":"USD"}
created_atstring(date-time)required

When the order was placed in your e-comm platform

Example: "2024-11-26T17:32:28Z"
financial_statusstringrequired
Enum"pending""paid""refunded""voided"
Example: "paid"
customerobject(Customer)required
customer.​shop_customer_idstringrequired

Your ID for the Customer

Example: "7461"
customer.​first_namestringrequired
Example: "Sally"
customer.​last_namestringrequired
Example: "Loo"
customer.​emailstring(email)
Example: "sally@example.com"
customer.​phone_numberstring(phone)
Example: "+13105551234"
shipping_addressobject(Address)required
shipping_address.​address1stringrequired
Example: "123 Main St"
shipping_address.​address2string
Example: "Unit 50"
shipping_address.​province_codestringrequired

Subdivision code (ISO-3166)

Example: "CA"
shipping_address.​citystringrequired
Example: "Los Angeles"
shipping_address.​postal_codestringrequired
Example: "90210"
shipping_address.​country_codestringrequired

Alpha-2 country code (ISO-3166)

Example: "US"
shipping_address.​phone_numberstring(phone)required
Example: "+13105551234"
line_itemsArray of objects(LineItem)required
line_items[].​shop_line_item_idstringrequired

Your ID for the Line Item

Example: "816721"
line_items[].​shop_product_idstringrequired

Your ID for the product

Example: "142"
line_items[].​shop_variant_idstringrequired

Your ID or SKU for the variant

Example: "7261"
line_items[].​namestringrequired

Name for the product and variant purchased

Example: "Cool T-shirt - Red"
line_items[].​unit_priceanyrequired

Item price in order's currency

Example: {"cents":500,"currency":"USD"}
line_items[].​total_priceanyrequired

Line item total in order's currency

Example: {"cents":1000,"currency":"USD"}
line_items[].​total_price_presentmentany

Line item total in customer's currency

Example: {"cents":1000,"currency":"USD"}
line_items[].​quantityinteger(int32)required
Example: 2
line_items[].​image_urlstring(url)required

URL to an image of the item

Example: "https://placecats.com/neo/300/200.png"
line_items[].​gramsinteger(int32)required

Weight of the item in grams

Example: 24
line_items[].​is_insuredbooleanrequired

Whether the item should be insured by Onward (generally you should set this to true for shippable items and false for digital items). Requires purchase token and amount insured in the Order.

Example: true
line_items[].​refunded_quantityinteger(int32)

Number of items refunded (for full or partial refunds)

Example: 1
line_items[].​refunded_priceany

Total refunded amount in order's currency

Example: {"cents":500,"currency":"USD"}
line_items[].​refunded_price_presentmentany

Total refunded amount in customer's currency

Example: {"cents":500,"currency":"USD"}
Response
application/json
{ "shop_order_id": "18282", "shop_order_number": "W-94713", "subtotal_price": { "cents": 1999, "currency": "USD" }, "subtotal_price_presentment": { "cents": 1999, "currency": "USD" }, "total_discounts_price": { "cents": 599, "currency": "USD" }, "total_discounts_price_presentment": { "cents": 599, "currency": "USD" }, "total_shipping_price": { "cents": 299, "currency": "USD" }, "total_shipping_price_presentment": { "cents": 299, "currency": "USD" }, "total_tax_price": { "cents": 143, "currency": "USD" }, "total_tax_price_presentment": { "cents": 143, "currency": "USD" }, "total_price": { "cents": 2499, "currency": "USD" }, "total_price_presentment": { "cents": 2499, "currency": "USD" }, "insurance_paid": { "cents": 2499, "currency": "USD" }, "amount_insured": { "cents": 1200, "currency": "USD" }, "amount_insured_presentment": { "cents": 1200, "currency": "USD" }, "created_at": "2024-11-26T17:32:28Z", "financial_status": "paid", "customer": { "shop_customer_id": "7461", "first_name": "Sally", "last_name": "Loo", "email": "sally@example.com", "phone_number": "+13105551234" }, "shipping_address": { "address1": "123 Main St", "address2": "Unit 50", "province_code": "CA", "city": "Los Angeles", "postal_code": "90210", "country_code": "US", "phone_number": "+13105551234" }, "line_items": [ {} ] }

Add insurance to an existing order

Request

If the customer did not purchase insurance during checkout, you can merchant-insure an order after-the-fact with this endpoint. Note: it is very important that you verify the status code of this request as not every order is eligible for insurance.

Security
api_key
Path
shopOrderIdstringrequired

Your ID for the Order

Headers
Content-Typestringrequired

Content-Type must be application/json

Example: application/json
Acceptstringrequired

Accept must be application/json

Example: application/json
curl -i -X PATCH \
  'https://app.useonward.com/api/v1/orders/{shopOrderId}/add_insurance' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY_HERE'

Responses

Insurance added successfully

Shipments

Physical shipments of items within an order and their tracking events.

Operations

Quotes

Insurance quotes for customers during checkout.

Operations