Cost+Docs

Create a new order

Create a new payment order. The response shape depends on the request body: - If you send a `transactions` array, each transaction object in the response contains its own `payment_url`. Redirect the customer to that URL. - If you omit `transactions`, the order has a top-level `order_url` instead — the hosted page lets the customer pick from all enabled payment methods. See the [Hosted Payment Page guide](/docs/guides/hosted-payment-page) for both flows side by side.

POST
/orders

Authorization

basicAuth
AuthorizationBasic <token>

Use your API key as the username and leave the password empty. Encode as Base64: {api_key}: (note the trailing colon).

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -u YOUR_API_KEY: \  -X POST https://api.costplus.online/v1/orders/ \  -H 'Content-Type: application/json' \  -d '{    "amount": 1295,    "currency": "EUR",    "merchant_order_id": "ORDER-1",    "description": "Test order",    "return_url": "https://example.com/return",    "failure_url": "https://example.com/cancel",    "webhook_url": "https://example.com/webhook",    "transactions": [{ "payment_method": "credit-card" }]  }'

{
  "id": "4851e31c-4137-4e91-95ef-1df945ee76a2",
  "merchant_order_id": "my-order-id-1",
  "status": "new",
  "currency": "EUR",
  "amount": 1295,
  "description": "My amazing order",
  "created": "2026-01-15T12:00:05.433502+00:00",
  "modified": "2026-01-15T12:00:05.553125+00:00",
  "expiration_period": "PT1H",
  "return_url": "https://www.example.com",
  "webhook_url": "https://www.example.com/webhook",
  "transactions": [
    {
      "id": "d291f03f-a406-428a-967a-4895a46e03fd",
      "payment_method": "credit-card",
      "status": "new",
      "amount": 1295,
      "currency": "EUR",
      "channel": "ecom",
      "credit_debit": "credit",
      "is_capturable": false,
      "expiration_period": "PT30M",
      "payment_url": "https://api.costplus.online/pay/4851e31c.../select-payment-method/credit-card/d291f03f.../",
      "payment_method_details": {}
    }
  ]
}

{
  "error": {
    "status": 400,
    "type": "string",
    "value": "string",
    "property_path": "string",
    "property_description": "string"
  }
}
{
  "error": {
    "status": 400,
    "type": "string",
    "value": "string",
    "property_path": "string",
    "property_description": "string"
  }
}