# CourierAPP Connect documentation
WooCommerce 0.4.37 · OpenAPI 0.6.11
See https://app.courierapp.gr/connect/docs.html

## GET /v1/capabilities
Account mode, carriers, purchase permission and automatic destination limits

Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api, https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api-sandbox
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Account mode, carriers, purchase permission and automatic destination limits",
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "400": {
      "description": "Validation error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Missing/invalid/revoked/expired key",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "Scope forbidden",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "409": {
      "description": "Expired quote, changed retry, or label not ready",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "413": {
      "description": "Body exceeds 64 KiB",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "422": {
      "description": "Unsupported lane or incomplete shipment data",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "429": {
      "description": "60 requests per store per minute exceeded",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "Retry-After": {
          "schema": {
            "type": "integer"
          }
        }
      }
    },
    "503": {
      "description": "Unavailable or live purchase disabled",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
```

## POST /v1/quotes
Immutable merchant quote, valid for 15 minutes

Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api, https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api-sandbox
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Immutable merchant quote, valid for 15 minutes",
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "quotes"
            ],
            "properties": {
              "quotes": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "Validation error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Missing/invalid/revoked/expired key",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "Scope forbidden",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "409": {
      "description": "Expired quote, changed retry, or label not ready",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "413": {
      "description": "Body exceeds 64 KiB",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "422": {
      "description": "Unsupported lane or incomplete shipment data",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "429": {
      "description": "60 requests per store per minute exceeded",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "Retry-After": {
          "schema": {
            "type": "integer"
          }
        }
      }
    },
    "503": {
      "description": "Unavailable or live purchase disabled",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/QuoteRequest"
        },
        "example": {
          "origin": {
            "country": "GR",
            "postal": "71601",
            "city": "Heraklion"
          },
          "destination": {
            "country": "BE",
            "postal": "1000",
            "city": "Brussels"
          },
          "packages": [
            {
              "weightKg": 1,
              "lengthCm": 30,
              "widthCm": 20,
              "heightCm": 10
            }
          ],
          "declaredValueEur": 50
        }
      }
    }
  }
}
```

## POST /v1/shipments
Purchase postage for a confirmed paid store order once
The buyer pays the shop. This endpoint debits the shop owner’s prepaid CourierAPP wallet, not the buyer’s payment provider. A new live purchase requires an eligible business account, explicit merchant-wallet-2026-10-12 agreement, valid account quote and sufficient balance. Persist one immutable request and Idempotency-Key per order/parcel. If outcome is unknown, reconcile by same identity; never submit a second parcel identity.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api, https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api-sandbox
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Purchase postage for a confirmed paid store order once",
  "responses": {
    "202": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Shipment"
          }
        }
      }
    },
    "400": {
      "description": "Validation error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Missing/invalid/revoked/expired key",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "402": {
      "description": "Insufficient wallet balance; no order or debit committed"
    },
    "403": {
      "description": "Scope forbidden",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "409": {
      "description": "Expired quote, changed retry, or label not ready",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "413": {
      "description": "Body exceeds 64 KiB",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "422": {
      "description": "Unsupported lane or incomplete shipment data",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "429": {
      "description": "60 requests per store per minute exceeded",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "Retry-After": {
          "schema": {
            "type": "integer"
          }
        }
      }
    },
    "503": {
      "description": "Unavailable or live purchase disabled",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ShipmentCommand"
        }
      }
    }
  },
  "parameters": [
    {
      "in": "header",
      "name": "Idempotency-Key",
      "required": true,
      "schema": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_.:-]{8,160}$"
      },
      "description": "Stable per store/order/parcel. Persist command before sending. Retry unchanged; a changed payload is a conflict."
    }
  ],
  "description": "The buyer pays the shop. This endpoint debits the shop owner’s prepaid CourierAPP wallet, not the buyer’s payment provider. A new live purchase requires an eligible business account, explicit merchant-wallet-2026-10-12 agreement, valid account quote and sufficient balance. Persist one immutable request and Idempotency-Key per order/parcel. If outcome is unknown, reconcile by same identity; never submit a second parcel identity."
}
```

## GET /v1/shipments/{id}
Read an owned shipment

Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api, https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api-sandbox
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Read an owned shipment",
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Shipment"
          }
        }
      }
    },
    "400": {
      "description": "Validation error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Missing/invalid/revoked/expired key",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "Scope forbidden",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "409": {
      "description": "Expired quote, changed retry, or label not ready",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "413": {
      "description": "Body exceeds 64 KiB",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "422": {
      "description": "Unsupported lane or incomplete shipment data",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "429": {
      "description": "60 requests per store per minute exceeded",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "Retry-After": {
          "schema": {
            "type": "integer"
          }
        }
      }
    },
    "503": {
      "description": "Unavailable or live purchase disabled",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
```

## GET /v1/shipments/{id}/label
Retrieve the shipment label as a base64-encoded PDF
Returns authenticated JSON with mime_type and content_base64 (decode on the server), not raw PDF bytes. Sandbox labels are invalid for shipping. label_ready does not prove pickup, scan or delivery.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api, https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api-sandbox
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Retrieve the shipment label as a base64-encoded PDF",
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Label"
          }
        }
      }
    },
    "400": {
      "description": "Validation error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Missing/invalid/revoked/expired key",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "Scope forbidden",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "409": {
      "description": "Expired quote, changed retry, or label not ready",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "413": {
      "description": "Body exceeds 64 KiB",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "422": {
      "description": "Unsupported lane or incomplete shipment data",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "429": {
      "description": "60 requests per store per minute exceeded",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "Retry-After": {
          "schema": {
            "type": "integer"
          }
        }
      }
    },
    "503": {
      "description": "Unavailable or live purchase disabled",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  },
  "description": "Returns authenticated JSON with mime_type and content_base64 (decode on the server), not raw PDF bytes. Sandbox labels are invalid for shipping. label_ready does not prove pickup, scan or delivery."
}
```

## GET /v1/shipments/{id}/tracking
Read tracking and pickup independently
 Returns tracking_url when unified customer tracking is enabled. Never builds customer links from arbitrary tracking numbers.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api, https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api-sandbox
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Read tracking and pickup independently",
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "400": {
      "description": "Validation error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Missing/invalid/revoked/expired key",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "Scope forbidden",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "409": {
      "description": "Expired quote, changed retry, or label not ready",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "413": {
      "description": "Body exceeds 64 KiB",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "422": {
      "description": "Unsupported lane or incomplete shipment data",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "429": {
      "description": "60 requests per store per minute exceeded",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "Retry-After": {
          "schema": {
            "type": "integer"
          }
        }
      }
    },
    "503": {
      "description": "Unavailable or live purchase disabled",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  },
  "description": " Returns tracking_url when unified customer tracking is enabled. Never builds customer links from arbitrary tracking numbers."
}
```

## GET /v1/events
Poll owned lifecycle events with a durable cursor; up to 50
Persist the next_cursor string without numeric conversion. Deduplicate by event ID; assign one tracking notification sender.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api, https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api-sandbox
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Poll owned lifecycle events with a durable cursor; up to 50",
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "events": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "next_cursor": {
                "type": "string"
              }
            },
            "required": [
              "events",
              "next_cursor"
            ]
          }
        }
      }
    },
    "400": {
      "description": "Validation error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Missing/invalid/revoked/expired key",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "Scope forbidden",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "409": {
      "description": "Expired quote, changed retry, or label not ready",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "413": {
      "description": "Body exceeds 64 KiB",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "422": {
      "description": "Unsupported lane or incomplete shipment data",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "429": {
      "description": "60 requests per store per minute exceeded",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "headers": {
        "Retry-After": {
          "schema": {
            "type": "integer"
          }
        }
      }
    },
    "503": {
      "description": "Unavailable or live purchase disabled",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  },
  "parameters": [
    {
      "name": "after",
      "in": "query",
      "schema": {
        "type": "string",
        "pattern": "^\\d{1,18}$",
        "default": "0"
      }
    }
  ],
  "description": "Persist the next_cursor string without numeric conversion. Deduplicate by event ID; assign one tracking notification sender."
}
```

## GET /v1/quotes/{id}/validate
Revalidate quote and account price before payment

Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api, https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api-sandbox
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Revalidate quote and account price before payment",
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Still valid; quote_id, total_cents, currency and expires_at"
    },
    "409": {
      "description": "Expired or changed account price; refresh before payment"
    }
  }
}
```

## POST /v1/shipments/{id}/cancellation
Record an owned cancellation request; no automatic carrier cancellation or refund
Live endpoint only. Keep the same reason and idempotency key on retries. A 202 acknowledgement records a request, not a completed cancellation. Unknown outcomes require reconciliation.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api, https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api-sandbox
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Record an owned cancellation request; no automatic carrier cancellation or refund",
  "description": "Live endpoint only. Keep the same reason and idempotency key on retries. A 202 acknowledgement records a request, not a completed cancellation. Unknown outcomes require reconciliation.",
  "parameters": [
    {
      "in": "header",
      "name": "Idempotency-Key",
      "required": true,
      "schema": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_.:-]{8,160}$"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "reason"
          ],
          "properties": {
            "reason": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          "additionalProperties": false
        }
      }
    }
  },
  "responses": {
    "202": {
      "description": "Cancellation request recorded",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "shipment_id": {
                "type": "string",
                "format": "uuid"
              },
              "state": {
                "enum": [
                  "requested",
                  "processing",
                  "carrier_cancelled",
                  "refunded",
                  "rejected",
                  "reconciliation_required"
                ]
              },
              "refund_cents": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "currency": {
                "const": "EUR"
              },
              "error_code": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    },
    "401": {
      "description": "Authentication required"
    },
    "403": {
      "description": "Shipment write scope required"
    },
    "404": {
      "description": "Owned shipment not found"
    },
    "409": {
      "description": "Idempotency conflict"
    }
  }
}
```

## GET /v1/shipments/{id}/cancellation
Read cancellation status for an owned shipment

Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api, https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api-sandbox
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Read cancellation status for an owned shipment",
  "responses": {
    "200": {
      "description": "Current request state",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "shipment_id": {
                "type": "string",
                "format": "uuid"
              },
              "state": {
                "enum": [
                  "requested",
                  "processing",
                  "carrier_cancelled",
                  "refunded",
                  "rejected",
                  "reconciliation_required"
                ]
              },
              "refund_cents": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "currency": {
                "const": "EUR"
              },
              "error_code": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    },
    "404": {
      "description": "No owned cancellation request"
    }
  }
}
```

## GET /v1/shipments/{id}/settlement
Read owned shipment wallet debits, credits and reconciliation state
Live endpoint only. Does not create an invoice or refund the shopper payment. Amounts are integer EUR cents.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api, https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api-sandbox
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Read owned shipment wallet debits, credits and reconciliation state",
  "description": "Live endpoint only. Does not create an invoice or refund the shopper payment. Amounts are integer EUR cents.",
  "responses": {
    "200": {
      "description": "Merchant wallet settlement report",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "shipment_id": {
                "type": "string",
                "format": "uuid"
              },
              "production_wallet": {
                "type": "boolean"
              },
              "debit_cents": {
                "type": "integer"
              },
              "refund_cents": {
                "type": "integer"
              },
              "net_charge_cents": {
                "type": "integer"
              },
              "currency": {
                "const": "EUR"
              },
              "reconciliation_required": {
                "type": "boolean"
              }
            }
          }
        }
      }
    },
    "404": {
      "description": "Owned shipment not found"
    }
  }
}
```

## GET /v1/subscription
Read own store subscription and shared account label quota

Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api, https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-api-sandbox
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Read own store subscription and shared account label quota",
  "responses": {
    "200": {
      "description": "Current server-verified entitlement",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "environment": {
                "enum": [
                  "test",
                  "live"
                ]
              },
              "plan_id": {
                "type": "string"
              },
              "active": {
                "type": "boolean"
              },
              "used": {
                "type": "integer",
                "minimum": 0
              },
              "limit": {
                "type": "integer",
                "minimum": 0
              },
              "period_end": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "environment",
              "plan_id",
              "active",
              "used",
              "limit"
            ]
          }
        }
      }
    },
    "401": {
      "description": "Invalid merchant key"
    }
  }
}
```

## GET /v1/status
Read SMS settings, balance and latest jobs
Requires shipments:read. Secrets and full phone numbers are never returned.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-sms
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Read SMS settings, balance and latest jobs",
  "description": "Requires shipments:read. Secrets and full phone numbers are never returned.",
  "servers": [
    {
      "url": "https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-sms",
      "description": "Isolated optional notification service; disabled until explicitly configured"
    }
  ],
  "tags": [
    "SMS"
  ],
  "security": [
    {
      "MerchantKey": []
    }
  ],
  "responses": {
    "200": {
      "description": "Result. Preview never dispatches. Sync only queues a verified shipment event.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "401": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "403": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "409": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "422": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "429": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "503": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
```

## POST /v1/preview
Preview one SMS and its destination-specific cost
Requires shipments:read and shipments:write. Cost is expressed in micro-EUR: 1000000 = EUR1. No send is performed.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-sms
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Preview one SMS and its destination-specific cost",
  "description": "Requires shipments:read and shipments:write. Cost is expressed in micro-EUR: 1000000 = EUR1. No send is performed.",
  "servers": [
    {
      "url": "https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-sms",
      "description": "Isolated optional notification service; disabled until explicitly configured"
    }
  ],
  "tags": [
    "SMS"
  ],
  "security": [
    {
      "MerchantKey": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "phone": {
              "type": "string",
              "pattern": "^\\+[1-9][0-9]{7,14}$"
            },
            "kind": {
              "enum": [
                "in_transit",
                "out_for_delivery",
                "delivered"
              ]
            },
            "carrier": {
              "type": "string"
            },
            "tracking": {
              "type": "string"
            }
          },
          "required": [
            "phone",
            "kind",
            "carrier",
            "tracking"
          ],
          "additionalProperties": false
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Result. Preview never dispatches. Sync only queues a verified shipment event.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "401": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "403": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "409": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "422": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "429": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "503": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
```

## POST /v1/settings
Configure optional SMS for new shipments
Requires shipments:read and shipments:write. Live platform mode stays unavailable until enabled server-side. Sandbox simulates messages and cannot send real SMS. Only shipments created after opt-in qualify.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-sms
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Configure optional SMS for new shipments",
  "description": "Requires shipments:read and shipments:write. Live platform mode stays unavailable until enabled server-side. Sandbox simulates messages and cannot send real SMS. Only shipments created after opt-in qualify.",
  "servers": [
    {
      "url": "https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-sms",
      "description": "Isolated optional notification service; disabled until explicitly configured"
    }
  ],
  "tags": [
    "SMS"
  ],
  "security": [
    {
      "MerchantKey": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "provider_mode": {
              "enum": [
                "byo",
                "platform"
              ]
            },
            "api_key": {
              "type": "string",
              "writeOnly": true,
              "description": "Optional replacement Yuboto Base64 API key; omit to retain existing encrypted key"
            },
            "remove_key": {
              "type": "boolean"
            },
            "sender_id": {
              "type": "string",
              "maxLength": 11
            },
            "locale": {
              "enum": [
                "el",
                "en",
                "de"
              ]
            },
            "prefixes": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[1-9][0-9]{0,3}$"
              },
              "minItems": 1,
              "maxItems": 40
            },
            "kinds": {
              "type": "array",
              "items": {
                "enum": [
                  "in_transit",
                  "out_for_delivery",
                  "delivered"
                ]
              },
              "maxItems": 3
            },
            "max_segments": {
              "const": 1
            },
            "message_cap_micros": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5000000
            },
            "monthly_cap_micros": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000000000
            }
          },
          "required": [
            "enabled",
            "provider_mode",
            "sender_id",
            "locale",
            "prefixes",
            "kinds",
            "max_segments",
            "message_cap_micros",
            "monthly_cap_micros"
          ],
          "additionalProperties": false
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Result. Preview never dispatches. Sync only queues a verified shipment event.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "401": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "403": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "409": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "422": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "429": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "503": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
```

## POST /v1/sync
Queue an eligible physical shipment event once
Requires shipments:read and shipments:write. Shipment must belong to the authenticated store. This is not an arbitrary-number message sending endpoint. A label or payment alone never counts as a physical scan. Unknown provider outcomes are held without blind retry.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-sms
Authentication: [{"MerchantKey": []}]
```json
{
  "summary": "Queue an eligible physical shipment event once",
  "description": "Requires shipments:read and shipments:write. Shipment must belong to the authenticated store. This is not an arbitrary-number message sending endpoint. A label or payment alone never counts as a physical scan. Unknown provider outcomes are held without blind retry.",
  "servers": [
    {
      "url": "https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-sms",
      "description": "Isolated optional notification service; disabled until explicitly configured"
    }
  ],
  "tags": [
    "SMS"
  ],
  "security": [
    {
      "MerchantKey": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "shipment_id": {
              "type": "string",
              "format": "uuid"
            }
          },
          "required": [
            "shipment_id"
          ],
          "additionalProperties": false
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Result. Preview never dispatches. Sync only queues a verified shipment event.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "401": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "403": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "409": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "422": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "429": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "503": {
      "description": "Request rejected without sending an SMS",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
```

## GET /stores/{store_id}/carriers
List encrypted carrier connections and read-only verification date. Shipment activation remains gated.

Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "List encrypted carrier connections and read-only verification date. Shipment activation remains gated.",
  "security": [
    {
      "OwnerJWT": []
    }
  ],
  "responses": {
    "200": {
      "description": "Owner-scoped success. No credentials are returned."
    },
    "401": {
      "description": "Owner authentication required"
    },
    "403": {
      "description": "Ownership or active matching-environment subscription required"
    },
    "429": {
      "description": "Provider rate limit reached"
    }
  }
}
```

## POST /stores/{store_id}/carriers/couriercenter
Save tenant-bound Courier Center API credentials; reset previous verification. No shipment created.

Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "Save tenant-bound Courier Center API credentials; reset previous verification. No shipment created.",
  "security": [
    {
      "OwnerJWT": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "credentials"
          ],
          "properties": {
            "credentials": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "UserAlias",
                "CredentialValue",
                "ApiKey",
                "CarrierBillingAccount"
              ],
              "properties": {
                "UserAlias": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500,
                  "writeOnly": true
                },
                "CredentialValue": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500,
                  "writeOnly": true
                },
                "ApiKey": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500,
                  "writeOnly": true
                },
                "CarrierBillingAccount": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500,
                  "writeOnly": true
                }
              }
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Owner-scoped success. No credentials are returned."
    },
    "401": {
      "description": "Owner authentication required"
    },
    "403": {
      "description": "Ownership or active matching-environment subscription required"
    },
    "429": {
      "description": "Provider rate limit reached"
    }
  }
}
```

## POST /stores/{store_id}/carriers/couriercenter/verify
Verify read-only access to an existing voucher on the connected carrier account. Does not enable shipment creation.

Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "Verify read-only access to an existing voucher on the connected carrier account. Does not enable shipment creation.",
  "security": [
    {
      "OwnerJWT": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "tracking_number"
          ],
          "properties": {
            "tracking_number": {
              "type": "string",
              "pattern": "^[0-9]{10,20}$"
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Owner-scoped success. No credentials are returned."
    },
    "401": {
      "description": "Owner authentication required"
    },
    "403": {
      "description": "Ownership or active matching-environment subscription required"
    },
    "429": {
      "description": "Provider rate limit reached"
    }
  }
}
```

## GET /stores/{store_id}/operations
Plan, label/email/SMS balances, current configuration and latest workflow outcomes
Owner JWT for a specific store, or its scoped merchant API key. Read requires shipments:read; writes require shipments:write. Use the dashboard for the complete versioned configuration. No historical resend.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}, {"MerchantKey": []}]
```json
{
  "summary": "Plan, label/email/SMS balances, current configuration and latest workflow outcomes",
  "description": "Owner JWT for a specific store, or its scoped merchant API key. Read requires shipments:read; writes require shipments:write. Use the dashboard for the complete versioned configuration. No historical resend.",
  "security": [
    {
      "OwnerJWT": []
    },
    {
      "MerchantKey": []
    }
  ],
  "responses": {
    "200": {
      "description": "Owner-scoped success. No credentials are returned."
    },
    "401": {
      "description": "Owner authentication required"
    },
    "403": {
      "description": "Ownership or active matching-environment subscription required"
    },
    "429": {
      "description": "Provider rate limit reached"
    }
  }
}
```

## POST /stores/{store_id}/workflow
Save per-store email templates, stages, caps and order status mapping
Owner JWT for a specific store, or its scoped merchant API key. Read requires shipments:read; writes require shipments:write. Use the dashboard for the complete versioned configuration. No historical resend.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}, {"MerchantKey": []}]
```json
{
  "summary": "Save per-store email templates, stages, caps and order status mapping",
  "description": "Owner JWT for a specific store, or its scoped merchant API key. Read requires shipments:read; writes require shipments:write. Use the dashboard for the complete versioned configuration. No historical resend.",
  "security": [
    {
      "OwnerJWT": []
    },
    {
      "MerchantKey": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Owner-scoped success. No credentials are returned."
    },
    "401": {
      "description": "Owner authentication required"
    },
    "403": {
      "description": "Ownership or active matching-environment subscription required"
    },
    "429": {
      "description": "Provider rate limit reached"
    }
  }
}
```

## POST /stores/{store_id}/workflow/preview
Preview a configured email without sending
Owner JWT for a specific store, or its scoped merchant API key. Read requires shipments:read; writes require shipments:write. Use the dashboard for the complete versioned configuration. No historical resend.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}, {"MerchantKey": []}]
```json
{
  "summary": "Preview a configured email without sending",
  "description": "Owner JWT for a specific store, or its scoped merchant API key. Read requires shipments:read; writes require shipments:write. Use the dashboard for the complete versioned configuration. No historical resend.",
  "security": [
    {
      "OwnerJWT": []
    },
    {
      "MerchantKey": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Owner-scoped success. No credentials are returned."
    },
    "401": {
      "description": "Owner authentication required"
    },
    "403": {
      "description": "Ownership or active matching-environment subscription required"
    },
    "429": {
      "description": "Provider rate limit reached"
    }
  }
}
```

## GET /stores/{store_id}/carriers/couriercenter/tariff
Read or replace the owner-confirmed tax-inclusive postcode tariff

Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "Read or replace the owner-confirmed tax-inclusive postcode tariff",
  "parameters": [
    {
      "name": "store_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Authenticated owner result"
    },
    "403": {
      "description": "Owner or paid plan required"
    },
    "422": {
      "description": "Invalid tariff or activation confirmation"
    }
  },
  "security": [
    {
      "OwnerJWT": []
    }
  ]
}
```

## POST /stores/{store_id}/carriers/couriercenter/tariff
Read or replace the owner-confirmed tax-inclusive postcode tariff
Optional cod configuration requires explicit own-account opt-in, an agreed maximum and confirmation that COD fees are included. Defaults off.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "Read or replace the owner-confirmed tax-inclusive postcode tariff",
  "parameters": [
    {
      "name": "store_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Authenticated owner result"
    },
    "403": {
      "description": "Owner or paid plan required"
    },
    "422": {
      "description": "Invalid tariff or activation confirmation"
    }
  },
  "description": "Optional cod configuration requires explicit own-account opt-in, an agreed maximum and confirmation that COD fees are included. Defaults off.",
  "security": [
    {
      "OwnerJWT": []
    }
  ]
}
```

## POST /stores/{store_id}/carriers/couriercenter/activate
Enable this owner connection; global production gate still applies

Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "Enable this owner connection; global production gate still applies",
  "parameters": [
    {
      "name": "store_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Authenticated owner result"
    },
    "403": {
      "description": "Owner or paid plan required"
    },
    "422": {
      "description": "Invalid tariff or activation confirmation"
    }
  },
  "security": [
    {
      "OwnerJWT": []
    }
  ]
}
```

## POST /stores/{store_id}/carriers/speedex
SPEEDEX merchant-owned connection
Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "SPEEDEX merchant-owned connection",
  "security": [
    {
      "OwnerJWT": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "credentials"
          ],
          "properties": {
            "credentials": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "username",
                "password",
                "customer_id",
                "agreement_id"
              ],
              "properties": {
                "username": {
                  "type": "string",
                  "writeOnly": true
                },
                "password": {
                  "type": "string",
                  "writeOnly": true
                },
                "customer_id": {
                  "type": "string",
                  "writeOnly": true
                },
                "agreement_id": {
                  "type": "string",
                  "writeOnly": true
                }
              }
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Owner-scoped success. No credentials are returned."
    },
    "401": {
      "description": "Owner authentication required"
    },
    "403": {
      "description": "Ownership or active matching-environment subscription required"
    },
    "429": {
      "description": "Provider rate limit reached"
    }
  },
  "description": "Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance."
}
```

## POST /stores/{store_id}/carriers/speedex/verify
SPEEDEX merchant-owned connection/verify
Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "SPEEDEX merchant-owned connection/verify",
  "security": [
    {
      "OwnerJWT": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "additionalProperties": false
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Owner-scoped success. No credentials are returned."
    },
    "401": {
      "description": "Owner authentication required"
    },
    "403": {
      "description": "Ownership or active matching-environment subscription required"
    },
    "429": {
      "description": "Provider rate limit reached"
    }
  },
  "description": "Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance."
}
```

## GET /stores/{store_id}/carriers/speedex/tariff
SPEEDEX merchant-owned connection/tariff
Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "SPEEDEX merchant-owned connection/tariff",
  "parameters": [
    {
      "name": "store_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Authenticated owner result"
    },
    "403": {
      "description": "Owner or paid plan required"
    },
    "422": {
      "description": "Invalid tariff or activation confirmation"
    }
  },
  "description": "Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.",
  "security": [
    {
      "OwnerJWT": []
    }
  ]
}
```

## POST /stores/{store_id}/carriers/speedex/tariff
SPEEDEX merchant-owned connection/tariff
Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "SPEEDEX merchant-owned connection/tariff",
  "parameters": [
    {
      "name": "store_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Authenticated owner result"
    },
    "403": {
      "description": "Owner or paid plan required"
    },
    "422": {
      "description": "Invalid tariff or activation confirmation"
    }
  },
  "description": "Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.",
  "security": [
    {
      "OwnerJWT": []
    }
  ]
}
```

## POST /stores/{store_id}/carriers/speedex/activate
SPEEDEX merchant-owned connection/activate
Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "SPEEDEX merchant-owned connection/activate",
  "parameters": [
    {
      "name": "store_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Authenticated owner result"
    },
    "403": {
      "description": "Owner or paid plan required"
    },
    "422": {
      "description": "Invalid tariff or activation confirmation"
    }
  },
  "description": "Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "enable",
            "account_is_mine"
          ],
          "properties": {
            "enable": {
              "type": "boolean",
              "enum": [
                true
              ]
            },
            "account_is_mine": {
              "type": "boolean",
              "enum": [
                true
              ]
            },
            "production_account_confirmed": {
              "type": "boolean",
              "description": "Must be true for a live SPEEDEX/ACS store."
            },
            "manual_handover": {
              "type": "boolean",
              "description": "Must be true for a live SPEEDEX/ACS store. Pickup, and ACS manifest, are organized separately by the merchant."
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "OwnerJWT": []
    }
  ]
}
```

## POST /stores/{store_id}/carriers/acs
ACS merchant-owned connection
Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "ACS merchant-owned connection",
  "security": [
    {
      "OwnerJWT": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "credentials"
          ],
          "properties": {
            "credentials": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "api_key",
                "company_id",
                "company_password",
                "user_id",
                "user_password",
                "billing_code"
              ],
              "properties": {
                "api_key": {
                  "type": "string",
                  "writeOnly": true
                },
                "company_id": {
                  "type": "string",
                  "writeOnly": true
                },
                "company_password": {
                  "type": "string",
                  "writeOnly": true
                },
                "user_id": {
                  "type": "string",
                  "writeOnly": true
                },
                "user_password": {
                  "type": "string",
                  "writeOnly": true
                },
                "billing_code": {
                  "type": "string",
                  "writeOnly": true
                }
              }
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Owner-scoped success. No credentials are returned."
    },
    "401": {
      "description": "Owner authentication required"
    },
    "403": {
      "description": "Ownership or active matching-environment subscription required"
    },
    "429": {
      "description": "Provider rate limit reached"
    }
  },
  "description": "Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance."
}
```

## POST /stores/{store_id}/carriers/acs/verify
ACS merchant-owned connection/verify
Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "ACS merchant-owned connection/verify",
  "security": [
    {
      "OwnerJWT": []
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "additionalProperties": false
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Owner-scoped success. No credentials are returned."
    },
    "401": {
      "description": "Owner authentication required"
    },
    "403": {
      "description": "Ownership or active matching-environment subscription required"
    },
    "429": {
      "description": "Provider rate limit reached"
    }
  },
  "description": "Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance."
}
```

## GET /stores/{store_id}/carriers/acs/tariff
ACS merchant-owned connection/tariff
Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "ACS merchant-owned connection/tariff",
  "parameters": [
    {
      "name": "store_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Authenticated owner result"
    },
    "403": {
      "description": "Owner or paid plan required"
    },
    "422": {
      "description": "Invalid tariff or activation confirmation"
    }
  },
  "description": "Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.",
  "security": [
    {
      "OwnerJWT": []
    }
  ]
}
```

## POST /stores/{store_id}/carriers/acs/tariff
ACS merchant-owned connection/tariff
Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "ACS merchant-owned connection/tariff",
  "parameters": [
    {
      "name": "store_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Authenticated owner result"
    },
    "403": {
      "description": "Owner or paid plan required"
    },
    "422": {
      "description": "Invalid tariff or activation confirmation"
    }
  },
  "description": "Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.",
  "security": [
    {
      "OwnerJWT": []
    }
  ]
}
```

## POST /stores/{store_id}/carriers/acs/activate
ACS merchant-owned connection/activate
Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.
Base URLs: https://swdjgtbhifglgnnmwthf.supabase.co/functions/v1/merchant-integrations
Authentication: [{"OwnerJWT": []}]
```json
{
  "summary": "ACS merchant-owned connection/activate",
  "parameters": [
    {
      "name": "store_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "format": "uuid"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Authenticated owner result"
    },
    "403": {
      "description": "Owner or paid plan required"
    },
    "422": {
      "description": "Invalid tariff or activation confirmation"
    }
  },
  "description": "Sandbox uses synthetic data. Live requires the merchant's own production credentials, read-only verification, agreed tariff and explicit per-store activation. No pickup or account-wide manifest is created. ACS live cancellation requires ACS assistance.",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "enable",
            "account_is_mine"
          ],
          "properties": {
            "enable": {
              "type": "boolean",
              "enum": [
                true
              ]
            },
            "account_is_mine": {
              "type": "boolean",
              "enum": [
                true
              ]
            },
            "production_account_confirmed": {
              "type": "boolean",
              "description": "Must be true for a live SPEEDEX/ACS store."
            },
            "manual_handover": {
              "type": "boolean",
              "description": "Must be true for a live SPEEDEX/ACS store. Pickup, and ACS manifest, are organized separately by the merchant."
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "OwnerJWT": []
    }
  ]
}
```
