Orders

Transfer order overpayment to a new voucher

Move an order's overpayment balance into a freshly-issued voucher. Used when a customer has paid more than the order's total — for example after a partial refund or a price adjustment — and the operator wants to push the surplus into a gift voucher rather than refunding it back to the original payment method.

Specify the voucher_type_id to choose which VoucherType the new voucher should inherit its expiry, terms and presentation from. The voucher type must belong to the order's site.

On success the new VoucherCode is returned. The order's payment ledger picks up a redemption line so the overpayment no longer appears in the outstanding balance.

Common failure modes:

  • 400 Bad Request — the order has no overpayment, the voucher type doesn't exist on this site, or the underlying voucher issuance failed (typically a configuration problem on the voucher type).
post/shop/orders/{orderId}/overpayment-to-voucher

Request body

voucher_type_idstring required

The VoucherType to issue the new voucher under. Must belong to the order's site. The voucher inherits the type's expiry, terms and presentation defaults.

notesstring nullable

Free-form notes recorded against the new voucher. Plain text only; HTML markup is rejected.

Example request

{
  "voucher_type_id": "5f1a83b9d52d5c2c8b8b4567",
  "notes": "Issued from order overpayment after partial refund."
}

Response

A new voucher was issued for the order's overpayment.

Example response

{
  "data": {
    "code": "ABC123XYZ",
    "valid_from_date": "2026-01-01T00:00:00+00:00",
    "valid_to_date": "2027-01-01T00:00:00+00:00",
    "amount": 5000,
    "balance": 2500,
    "currency": "gbp",
    "value": 5000,
    "partially_redeemable": true,
    "uses_total": 7,
    "uses_remaining": 5,
    "fulfillment_status": "needs_dispatching",
    "voucher_type": {
      "name": "Spa Day Gift Voucher"
    },
    "recipient": {
      "name": "Jane Doe",
      "email": "jane@example.com"
    },
    "delivery": {
      "method": "post",
      "option": {
        "name": "First class mail",
        "price": 5000,
        "revenue_centre": "spa"
      }
    },
    "order": {
      "order_ref": "TRY00",
      "item_cost": 5000
    },
    "redemptions": [
      {
        "amount": 2500
      }
    ],
    "created_at": "2025-02-04T12:00:00+01:00",
    "issued_at": "2026-01-02T09:00:00+00:00"
  }
}

Changes

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