Orders
Trigger server-side completion
Completes a pending order server-side through the existing invoice completion pipeline. This is an explicit alias for integrations that look for a completion endpoint.
POST
/
dev
/
v1
/
orders
/
{id}
/
complete
Trigger server-side completion
curl --request POST \
--url https://api.shoppex.io/dev/v1/orders/{id}/complete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"note": "Completed by external gateway"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({note: 'Completed by external gateway'})
};
fetch('https://api.shoppex.io/dev/v1/orders/{id}/complete', 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}/complete"
payload = { "note": "Completed by external gateway" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'note' => 'Completed by external gateway'
]),
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}/complete"
payload := strings.NewReader("{\n \"note\": \"Completed by external gateway\"\n}")
req, _ := http.NewRequest("POST", 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_complete_1",
"uniqid": "cccccccc-cccc-4ccc-8ccc-cccccccccccc",
"shop_id": "shop_1",
"customer_id": null,
"customer_email": "[email protected]",
"affiliate_link_id": null,
"affiliate_customer_id": null,
"affiliate_code": null,
"affiliate_discount_amount": 0,
"currency": "USD",
"status": "COMPLETED",
"status_details": "Completed",
"payment_status": "COMPLETED",
"gateway": "PANDABASE",
"flow_type": "PROVIDER_SESSION",
"provider_reference": "ref_complete_1",
"provider_reference_type": "SESSION_ID",
"subtotal": 19.99,
"discount": 0,
"total": 19.99,
"custom_fields": {
"customFields": []
},
"checkout_url": null,
"items": [
{
"product_id": "prod_1",
"product_title": "Starter Pack",
"product_type": "SERVICE",
"variant_title": null,
"quantity": 1,
"unit_price": 19.99,
"total": 19.99
}
],
"created_at": 1711956300,
"updated_at": 1711956360
}
}{
"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>"
}
]
}
}Previous
Trigger server-side fulfillmentCompletes and fulfills a pending order server-side through the existing invoice completion pipeline.
Next
⌘I
Trigger server-side completion
curl --request POST \
--url https://api.shoppex.io/dev/v1/orders/{id}/complete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"note": "Completed by external gateway"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({note: 'Completed by external gateway'})
};
fetch('https://api.shoppex.io/dev/v1/orders/{id}/complete', 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}/complete"
payload = { "note": "Completed by external gateway" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'note' => 'Completed by external gateway'
]),
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}/complete"
payload := strings.NewReader("{\n \"note\": \"Completed by external gateway\"\n}")
req, _ := http.NewRequest("POST", 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_complete_1",
"uniqid": "cccccccc-cccc-4ccc-8ccc-cccccccccccc",
"shop_id": "shop_1",
"customer_id": null,
"customer_email": "[email protected]",
"affiliate_link_id": null,
"affiliate_customer_id": null,
"affiliate_code": null,
"affiliate_discount_amount": 0,
"currency": "USD",
"status": "COMPLETED",
"status_details": "Completed",
"payment_status": "COMPLETED",
"gateway": "PANDABASE",
"flow_type": "PROVIDER_SESSION",
"provider_reference": "ref_complete_1",
"provider_reference_type": "SESSION_ID",
"subtotal": 19.99,
"discount": 0,
"total": 19.99,
"custom_fields": {
"customFields": []
},
"checkout_url": null,
"items": [
{
"product_id": "prod_1",
"product_title": "Starter Pack",
"product_type": "SERVICE",
"variant_title": null,
"quantity": 1,
"unit_price": 19.99,
"total": 19.99
}
],
"created_at": 1711956300,
"updated_at": 1711956360
}
}{
"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>"
}
]
}
}