Skip to content
Hoursmith Docs
APIReferenceInvoices

Record a manual refund

Record a manual refund. Records money from a MANUAL payment that was already returned outside Hoursmith; moves no money. Card (Stripe) payments are rejected with 409 — issue those refunds in the Hoursmith app. Exactly one of `amount` or `fullRemaining: true` (remaining principal and fee). Refunds cannot be deleted and never reopen a PAID invoice. Domain-idempotent per Idempotency-Key/requestId. Write scope; Owner/Admin only.

POST
/invoices/{id}/payments/{paymentId}/refund

Authorization

BearerAuth
AuthorizationBearer <token>

Personal Access Token. Mint at Settings → API. Token shape: hsk_<env>_<prefix12>_<secret32>.

In: header

Path Parameters

id*string

Invoice id.

paymentId*string

Payment id from GET /invoices/{id}/payments.

Header Parameters

Idempotency-Key*string

Caller-generated UUID/ULID. Same key + same body within 24h replays the original response; money writes are additionally idempotent at the domain level for that key.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/payments/497f6eca-6276-4993-bfeb-53cbbbba6f08/refund" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{}'
{  "data": {    "refund": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "invoiceId": "4f163819-178d-470c-a246-d6768476a6ec",      "kind": "payment",      "provider": "manual",      "status": "pending",      "amount": "string",      "feeAmount": "string",      "feeLabel": "string",      "currency": "string",      "paidDate": "2019-08-24",      "methodId": "a79e32ca-882c-452b-a096-350276aed28d",      "methodLabel": "string",      "note": "string",      "refundOfPaymentId": "60024239-4a50-4f20-bd85-d743a04f16d0",      "refunded": {        "amount": "string",        "feeAmount": "string"      },      "refundable": {        "amount": "string",        "feeAmount": "string"      },      "refundPending": true,      "refundableViaApi": true,      "createdAt": "2019-08-24T14:15:22Z"    },    "payment": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "invoiceId": "4f163819-178d-470c-a246-d6768476a6ec",      "kind": "payment",      "provider": "manual",      "status": "pending",      "amount": "string",      "feeAmount": "string",      "feeLabel": "string",      "currency": "string",      "paidDate": "2019-08-24",      "methodId": "a79e32ca-882c-452b-a096-350276aed28d",      "methodLabel": "string",      "note": "string",      "refundOfPaymentId": "60024239-4a50-4f20-bd85-d743a04f16d0",      "refunded": {        "amount": "string",        "feeAmount": "string"      },      "refundable": {        "amount": "string",        "feeAmount": "string"      },      "refundPending": true,      "refundableViaApi": true,      "createdAt": "2019-08-24T14:15:22Z"    },    "invoice": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "number": "string",      "clientId": "5e505642-9024-474d-9434-e5a44f505cc5",      "status": "DRAFT",      "paymentStatus": "unpaid",      "currency": "string",      "total": "string",      "amountPaid": "string",      "balanceDue": "string",      "issueDate": "2019-08-24",      "dueDate": "2019-08-24",      "sentAt": "2019-08-24T14:15:22Z",      "lastSentAt": "2019-08-24T14:15:22Z",      "paidAt": "2019-08-24T14:15:22Z"    },    "replayed": true  },  "warnings": [    "string"  ]}
{  "data": {    "refund": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "invoiceId": "4f163819-178d-470c-a246-d6768476a6ec",      "kind": "payment",      "provider": "manual",      "status": "pending",      "amount": "string",      "feeAmount": "string",      "feeLabel": "string",      "currency": "string",      "paidDate": "2019-08-24",      "methodId": "a79e32ca-882c-452b-a096-350276aed28d",      "methodLabel": "string",      "note": "string",      "refundOfPaymentId": "60024239-4a50-4f20-bd85-d743a04f16d0",      "refunded": {        "amount": "string",        "feeAmount": "string"      },      "refundable": {        "amount": "string",        "feeAmount": "string"      },      "refundPending": true,      "refundableViaApi": true,      "createdAt": "2019-08-24T14:15:22Z"    },    "payment": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "invoiceId": "4f163819-178d-470c-a246-d6768476a6ec",      "kind": "payment",      "provider": "manual",      "status": "pending",      "amount": "string",      "feeAmount": "string",      "feeLabel": "string",      "currency": "string",      "paidDate": "2019-08-24",      "methodId": "a79e32ca-882c-452b-a096-350276aed28d",      "methodLabel": "string",      "note": "string",      "refundOfPaymentId": "60024239-4a50-4f20-bd85-d743a04f16d0",      "refunded": {        "amount": "string",        "feeAmount": "string"      },      "refundable": {        "amount": "string",        "feeAmount": "string"      },      "refundPending": true,      "refundableViaApi": true,      "createdAt": "2019-08-24T14:15:22Z"    },    "invoice": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "number": "string",      "clientId": "5e505642-9024-474d-9434-e5a44f505cc5",      "status": "DRAFT",      "paymentStatus": "unpaid",      "currency": "string",      "total": "string",      "amountPaid": "string",      "balanceDue": "string",      "issueDate": "2019-08-24",      "dueDate": "2019-08-24",      "sentAt": "2019-08-24T14:15:22Z",      "lastSentAt": "2019-08-24T14:15:22Z",      "paidAt": "2019-08-24T14:15:22Z"    },    "replayed": true  },  "warnings": [    "string"  ]}
{  "error": {    "code": "unauthenticated",    "message": "string",    "fields": {      "property1": "string",      "property2": "string"    },    "requiredPlan": "studio",    "feature": "string",    "requestId": "string"  }}
{  "error": {    "code": "unauthenticated",    "message": "string",    "fields": {      "property1": "string",      "property2": "string"    },    "requiredPlan": "studio",    "feature": "string",    "requestId": "string"  }}
{  "error": {    "code": "unauthenticated",    "message": "string",    "fields": {      "property1": "string",      "property2": "string"    },    "requiredPlan": "studio",    "feature": "string",    "requestId": "string"  }}
{  "error": {    "code": "unauthenticated",    "message": "string",    "fields": {      "property1": "string",      "property2": "string"    },    "requiredPlan": "studio",    "feature": "string",    "requestId": "string"  }}
{  "error": {    "code": "unauthenticated",    "message": "string",    "fields": {      "property1": "string",      "property2": "string"    },    "requiredPlan": "studio",    "feature": "string",    "requestId": "string"  }}
{  "error": {    "code": "unauthenticated",    "message": "string",    "fields": {      "property1": "string",      "property2": "string"    },    "requiredPlan": "studio",    "feature": "string",    "requestId": "string"  }}
Was this page helpful?