Affilibee
Toggle sidebar

Update order

API reference for updating certain fields on an order.

Endpoint

PATCH
/api/v2/orders/{uuid}

Authorization

Learn more
Authorization
string
header
required

The Bearer token generated in the Affilibee dashboard.

Body

application/json

total_shipping_value
integer
required

The total shipping value in cents. Validation: must be 0 or greater.

Example requests

curl -X PATCH "https://affilibee.com/api/v2/orders/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
    "total_shipping_value": 750
}'
const token = "YOUR_ACCESS_TOKEN";
const orderId = "550e8400-e29b-41d4-a716-446655440000";
const url = `https://affilibee.com/api/v2/orders/${orderId}`;

const response = await fetch(url, {
  method: "PATCH",
  headers: {
    "Authorization": `Bearer ${token}`,
    "Content-Type": "application/json",
    "Accept": "application/json"
  },
  body: JSON.stringify({
    total_shipping_value: 750
  })
});

const data = await response.json();
console.log(data);
import requests

token = "YOUR_ACCESS_TOKEN"
order_id = "550e8400-e29b-41d4-a716-446655440000"
url = f"https://affilibee.com/api/v2/orders/{order_id}"

response = requests.patch(
    url,
    headers={
        "Authorization": f"Bearer {token}",
        "Content-Type": "application/json",
        "Accept": "application/json",
    },
    json={
        "total_shipping_value": 750
    }
)

print(response.json())
<?php

require 'vendor/autoload.php';

use GuzzleHttp\Client;

$token = 'YOUR_ACCESS_TOKEN';
$orderId = '550e8400-e29b-41d4-a716-446655440000';

$client = new Client([
    'base_uri' => 'https://affilibee.com/api/v2',
    'headers' => [
        'Authorization' => "Bearer $token",
        'Accept' => 'application/json',
    ],
]);

$response = $client->patch("orders/{$orderId}", [
    'json' => [
        'total_shipping_value' => 750
    ]
]);

echo $response->getBody();
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        using var client = new HttpClient();
        var orderId = "550e8400-e29b-41d4-a716-446655440000";
        var url = $"https://affilibee.com/api/v2/orders/{orderId}";
        var token = "YOUR_ACCESS_TOKEN";

        var payload = new { total_shipping_value = 750 };
        var json = JsonSerializer.Serialize(payload);
        var content = new StringContent(json, Encoding.UTF8, "application/json");

        client.DefaultRequestHeaders.Add("Authorization", $"Bearer {token}");
        client.DefaultRequestHeaders.Add("Accept", "application/json");

        var response = await client.PatchAsync(url, content);
        var responseBody = await response.Content.ReadAsStringAsync();

        Console.WriteLine(responseBody);
    }
}

Responses

application/json

200
Success

Returned when the order is successfully updated.

401
Unauthorized

Returned when the request does not include a valid Bearer token.

404
Not Found

Returned when the order does not exist or does not belong to the merchant.

422
Unprocessable Content

Returned when the request fails validation.

Response examples

{
    "success": true,
    "data": {
        "order": {
            "uuid": "550e8400-e29b-41d4-a716-446655440000",
            "order_no": "54321",
            "affiliate_slug": "john-doe",
            "total_shipping_value": 750,
            "currency": {
                "code": "USD",
                "name": "United States Dollar"
            },
            "order_rows": [
                {
                    "uuid": "7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d",
                    "product_sku": "SKU-123",
                    "product_name": "Premium Widget",
                    "segment_slug": "default",
                    "price_value": 1000,
                    "tax_value": 100,
                    "quantity": 2
                }
            ],
            "customer": {
                "name": "Jane Smith",
                "email": "jane@example.com"
            },
            "cancelled_at": null
        }
    },
    "errors": null,
    "meta": {
        "trace_id": "20260321:api:abc12"
    }
}
{
    "success": false,
    "data": null,
    "errors": {
        "message": [
            "Unauthenticated."
        ]
    },
    "meta": {
        "trace_id": "20260321:api:abc12"
    }
}
{
    "success": false,
    "data": null,
    "errors": {
        "message": [
            "Not Found"
        ]
    },
    "meta": {
        "trace_id": "20260321:api:abc12"
    }
}
{
    "success": false,
    "data": null,
    "errors": {
        "total_shipping_value": [
            "The total shipping value field is required."
        ]
    },
    "meta": {
        "trace_id": "20260321:api:abc12"
    }
}

Notes

  • The order must belong to the authenticated merchant.

  • Currently, only the `total_shipping_value` field can be updated.

Got questions? We're here for you.

We help teams run affiliate programs through API-first integrations that fit the platform they already use.

© 2025 Affilibee Handelsbolag (969802-2481)

Integrations

API Integration
How can we assist you today?

Fill in the form below and we'll get back to you as soon as possible.

Name
Email
Message