Orders
Replace order affiliate attribution
Alias for PATCH /dev/v1/orders/:id.
PUT
/
dev
/
v1
/
orders
/
{id}
Replace order affiliate attribution
curl --request PUT \
--url https://api.shoppex.io/dev/v1/orders/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"referral_code": "creator123"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({referral_code: 'creator123'})
};
fetch('https://api.shoppex.io/dev/v1/orders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/orders/{id}"
payload = { "referral_code": "creator123" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/orders/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'referral_code' => 'creator123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoppex.io/dev/v1/orders/{id}"
payload := strings.NewReader("{\n \"referral_code\": \"creator123\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"id": "inv_put_1",
"uniqid": "dddddddd-dddd-4ddd-8ddd-dddddddddddd",
"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_put_1",
"provider_reference_type": "MANUAL_REFERENCE",
"subtotal": 10,
"discount": 0,
"total": 10,
"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": 10,
"total": 10
}
],
"created_at": 1711956000,
"updated_at": 1711956300
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}Authorizations
Use your Shoppex API key in the Authorization header.
Path Parameters
Body
application/jsonmultipart/form-datatext/plain
Response
Successful response
Show child attributes
Show child attributes
Previous
Trigger server-side completionCompletes a pending order server-side through the existing invoice completion pipeline. This is an explicit alias for integrations that look for a completion endpoint.
Next
⌘I
Replace order affiliate attribution
curl --request PUT \
--url https://api.shoppex.io/dev/v1/orders/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"referral_code": "creator123"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({referral_code: 'creator123'})
};
fetch('https://api.shoppex.io/dev/v1/orders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/orders/{id}"
payload = { "referral_code": "creator123" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/orders/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'referral_code' => 'creator123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoppex.io/dev/v1/orders/{id}"
payload := strings.NewReader("{\n \"referral_code\": \"creator123\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"id": "inv_put_1",
"uniqid": "dddddddd-dddd-4ddd-8ddd-dddddddddddd",
"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_put_1",
"provider_reference_type": "MANUAL_REFERENCE",
"subtotal": 10,
"discount": 0,
"total": 10,
"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": 10,
"total": 10
}
],
"created_at": 1711956000,
"updated_at": 1711956300
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}