TrellisDevelopers

Intents: Refund

POST
/payments/intents/{id}/refund

Path Parameters

id*string
Length1 <= length

Header Parameters

x-tenant-id?string

Selects the tenant by id. When both tenant headers are omitted, the server falls back to the configured default tenant slug.

x-tenant-slug?string

Selects the tenant by slug. Use this when you know the tenant slug instead of the tenant id.

x-location-id?string

Adds a location scope to the request for location-aware reads, writes, and audit entries.

x-auth-provider?"hexclave"

Test-only Hexclave provider identifier used with x-auth-user-id when trusted identity headers are explicitly enabled. Production clients must use a Hexclave bearer token.

Value in

  • "hexclave"
x-auth-user-id?string

Temporary auth subject used to resolve the acting staff user through the staff auth identity mapping.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/payments/intents/string/refund" \  -H "x-tenant-id: tenant-local" \  -H "x-tenant-slug: trellis-local" \  -H "x-location-id: loc-tasting-room" \  -H "x-auth-provider: hexclave" \  -H "x-auth-user-id: user_abc123" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "orderId": "string",  "locationId": "string",  "provider": "mock",  "merchantPaymentAccountId": "string",  "externalId": "string",  "providerPaymentIntentId": "string",  "paymentState": "pending",  "readerId": "string",  "amount": 0,  "currency": "string",  "captureMethod": "manual",  "status": "requires_payment_method",  "tenderType": "card_present",  "processorStatus": "OPEN",  "checkState": "open",  "refundStatus": "none",  "authorizedAmount": 0,  "capturedAmount": 0,  "refundedBaseAmount": 0,  "refundedTipAmount": 0,  "refundedAmount": 0,  "pendingTipAmount": 0,  "tipStatus": "none",  "tipEntrySource": "capture",  "tipPendingReason": "awaiting_adjustment",  "closedByStaffUserId": "string",  "attributedStaffUserId": "string",  "attributedShiftId": "string",  "attributedAt": "2019-08-24T14:15:22Z",  "splitTenderGroupId": "string",  "tipAmount": 0,  "tabName": "string",  "tabStatus": "open",  "preauthAmount": 1,  "metadata": {    "property1": "string",    "property2": "string"  },  "paidAt": "2019-08-24T14:15:22Z",  "capturedAt": "2019-08-24T14:15:22Z",  "closedAt": "2019-08-24T14:15:22Z",  "reopenedAt": "2019-08-24T14:15:22Z",  "tipAdjustedAt": "2019-08-24T14:15:22Z",  "voidedAt": "2019-08-24T14:15:22Z",  "refundedAt": "2019-08-24T14:15:22Z",  "refunds": [    {      "id": "string",      "amount": 0,      "tipAmount": 0,      "totalAmount": 1,      "reason": "string",      "lineItems": [        {          "orderLineId": "string",          "title": "string",          "subtotalAmount": 0,          "taxAmount": 0,          "totalAmount": 1        }      ],      "approvedByStaffUserId": "string",      "approvedAt": "2019-08-24T14:15:22Z"    }  ],  "authorization": {    "mode": "disabled",    "actorRoles": [      "string"    ],    "overrideStaffUserId": "string",    "overrideReason": "string",    "approvedAt": "2019-08-24T14:15:22Z"  },  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}