🚀 New: Theme Control Plane API — build, customize, and deploy themes programmatically. Learn more →
curl --request PATCH \
--url https://api.shoppex.io/dev/v1/orders/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"affiliate_code": "creator123"
}
'{
"data": {
"id": "inv_patch_1",
"uniqid": "cccccccc-cccc-4ccc-8ccc-cccccccccccc",
"shop_id": "shop_1",
"customer_id": null,
"customer_email": "[email protected]",
"affiliate_link_id": "link_1",
"affiliate_customer_id": "cus_aff_1",
"affiliate_code": "creator123",
"affiliate_discount_amount": 0,
"currency": "USD",
"status": "PENDING",
"payment_status": "PENDING",
"gateway": "MANUAL",
"flow_type": "MANUAL_CONFIRMATION",
"provider_reference": "ref_patch_1",
"provider_reference_type": "MANUAL_REFERENCE",
"subtotal": 29.98,
"discount": 0,
"total": 29.98,
"custom_fields": null,
"checkout_url": null,
"items": [
{
"product_id": "prod_1",
"product_title": "Starter Pack",
"product_type": "SERVICE",
"variant_title": null,
"quantity": 1,
"unit_price": 29.98,
"total": 29.98
}
],
"created_at": 1711956000,
"updated_at": 1711956300
}
}Assigns affiliate attribution to a pending order using affiliate_code, referral_code, or affiliate_id. This updates attribution and pending commission records, but does not recalculate order totals or discounts.
curl --request PATCH \
--url https://api.shoppex.io/dev/v1/orders/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"affiliate_code": "creator123"
}
'{
"data": {
"id": "inv_patch_1",
"uniqid": "cccccccc-cccc-4ccc-8ccc-cccccccccccc",
"shop_id": "shop_1",
"customer_id": null,
"customer_email": "[email protected]",
"affiliate_link_id": "link_1",
"affiliate_customer_id": "cus_aff_1",
"affiliate_code": "creator123",
"affiliate_discount_amount": 0,
"currency": "USD",
"status": "PENDING",
"payment_status": "PENDING",
"gateway": "MANUAL",
"flow_type": "MANUAL_CONFIRMATION",
"provider_reference": "ref_patch_1",
"provider_reference_type": "MANUAL_REFERENCE",
"subtotal": 29.98,
"discount": 0,
"total": 29.98,
"custom_fields": null,
"checkout_url": null,
"items": [
{
"product_id": "prod_1",
"product_title": "Starter Pack",
"product_type": "SERVICE",
"variant_title": null,
"quantity": 1,
"unit_price": 29.98,
"total": 29.98
}
],
"created_at": 1711956000,
"updated_at": 1711956300
}
}Use your Shoppex API key in the Authorization header.
Successful response
Show child attributes