Cost+ Docs

Status Requests

Check order and transaction statuses

Every payment in Cost+ is represented by an order that contains one or more transactions. You can check the current status of any order by querying the API, either by polling or by relying on webhooks.

Retrieving Order Status

Send a GET request to /v1/orders/\{id\}/ to retrieve the full order object including its current status and all associated transactions.

GET /v1/orders/b9ae6.../

[!TIP] While polling works for checking order status, webhooks are the recommended approach for production integrations. They provide real-time notifications without the overhead of repeated API calls.

Order Statuses

An order progresses through the following statuses:

StatusFinalDescription
newNoOrder has just been created. No payment attempt has been made yet.
processingNoA payment attempt is in progress. The customer may be completing 3D Secure or another verification step.
errorNoThe payment attempt failed. The customer can retry with the same or a different payment method.
completedYesPayment was successful. You can fulfill the order.
cancelledYesThe order was cancelled, either by the customer or via the API.
expiredYesThe order expired before a successful payment was made. The default expiration period is 30 minutes.

[!NOTE] Only statuses marked as Final = Yes are terminal. Orders in new, processing, or error status can still transition to completed.

Example: Order in Processing

When a customer has initiated payment but it is not yet complete:

{
  "id": "b9ae6...",
  "project_id": "proj_abc123",
  "merchant_order_id": "my-order-id-1",
  "created": "2024-01-01T12:00:00.000000+00:00",
  "modified": "2024-01-01T12:01:30.000000+00:00",
  "completed": null,
  "expiration_period": "PT30M",
  "status": "processing",
  "currency": "EUR",
  "amount": 1295,
  "description": "My amazing order",
  "return_url": "https://www.example.com",
  "payment_url": "https://pay.costplus.com/...",
  "webhook_url": "https://www.example.com/webhook",
  "transactions": [
    {
      "id": "txn_001...",
      "payment_method": "credit-card",
      "payment_method_brand": "visa",
      "status": "processing",
      "amount": 1295,
      "currency": "EUR"
    }
  ],
  "flags": ["is-test"]
}

Example: Completed Order

Once the payment is successful, the order reaches the completed status:

{
  "id": "b9ae6...",
  "project_id": "proj_abc123",
  "merchant_order_id": "my-order-id-1",
  "created": "2024-01-01T12:00:00.000000+00:00",
  "modified": "2024-01-01T12:02:15.000000+00:00",
  "completed": "2024-01-01T12:02:15.000000+00:00",
  "expiration_period": "PT30M",
  "status": "completed",
  "currency": "EUR",
  "amount": 1295,
  "description": "My amazing order",
  "return_url": "https://www.example.com",
  "payment_url": "https://pay.costplus.com/...",
  "webhook_url": "https://www.example.com/webhook",
  "transactions": [
    {
      "id": "txn_001...",
      "payment_method": "credit-card",
      "payment_method_brand": "visa",
      "payment_method_details": {
        "card_last_four": "4242",
        "card_expiry_month": 12,
        "card_expiry_year": 2026,
        "card_holder_name": "J. Smith"
      },
      "status": "completed",
      "amount": 1295,
      "currency": "EUR"
    }
  ],
  "flags": ["is-test"]
}

Transaction Details

Each transaction within an order contains the following key fields:

FieldDescription
payment_methodThe payment method used (e.g., credit-card, ideal, apple-pay)
payment_method_brandThe brand or issuer (e.g., visa, mastercard, amex)
payment_method_detailsAn object with method-specific details such as card last four digits, expiry, and holder name
statusThe status of this specific transaction
amountThe transaction amount in cents
currencyThe transaction currency

[!WARNING] Do not rely solely on the customer being redirected to your return_url as confirmation of payment. Always verify the order status via the API or through a webhook before fulfilling an order.

On this page