Orders

Add a payment to an order

Record a payment against an order. Use this endpoint to attach a manual payment — for example a cash payment taken at the front desk, a bank transfer that has cleared, or a card transaction taken via a terminal that is not integrated with Trybe.

The amount must be greater than zero, expressed in the lowest denomination of the order's currency (pennies for GBP, cents for USD, and so on). The created payment is returned in the data envelope along with its assigned id, status, and refundable amount.

Returns 400 Bad Request if the payment can't be added — for example because the amount exceeds the outstanding balance, or the order is in a state that no longer accepts new payments.

post/shop/orders/{orderId}/payments

Request body

amountinteger required

The amount of the payment, expressed in the lowest denomination of the order's currency (e.g. pennies for GBP, cents for USD). Must be greater than zero unless capture_method is on_demand and the request is being used to store a payment method for later charging — in which case 0 is also accepted.

capture_methodstring nullable

When the payment amount should be captured. Use automatic for an immediate capture (the default for most manual entries) or on_demand when storing a payment method to be charged later.

details_sourcestring nullable

How the payment method will be supplied — for example pay_by_link for a hosted checkout link, or terminal for an in-person card terminal.

processor_dataobject

An optional dictionary of processor-specific data. For on_demand payments this can include save_payment_method: true to persist the payment method against the customer for future use.

Example request

{
  "amount": 10000,
  "capture_method": "automatic",
  "details_source": "pay_by_link"
}

Response

A single payment recorded against an order.

Example response

{
  "data": {
    "amount": 10000,
    "capture_method": "automatic",
    "chargebacks": [
      {
        "currency": "gbp",
        "created_at": "2025-02-04T12:00:00+01:00"
      }
    ],
    "currency": "gbp",
    "details_source": "pay_by_link",
    "failure_reason": "Suspected fraud",
    "item_revenues": [
      {
        "revenue_centre": "spa",
        "gross_amount": 1500,
        "net_amount": 1250,
        "currency": "gbp"
      }
    ],
    "paid_at": "2020-02-24T12:00:00+01:00",
    "processor": "stripe",
    "refundable_amount": 3500,
    "refunds": [
      {
        "currency": "gbp"
      }
    ],
    "created_at": "2025-02-04T12:00:00+01:00"
  }
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.