Pay an invoice.
Pay an invoice
PreviewPOST
/admin/v1/invoices/{invoiceId}:paybody parameters
Returns
curl https://api.userhub.com/admin/v1/invoices/in_4QPqKvtqkpJzP7:pay \
-H "Authorization: Bearer $USERHUB_ADMIN_KEY" \
-X POST
const res = await adminApi.invoices.pay(
"in_4QPqKvtqkpJzP7",
);
res, err := adminApi.Invoices().Pay(
context.Background(),
"in_4QPqKvtqkpJzP7",
nil,
)
$res = $adminApi->invoices->pay(
invoiceId: 'in_4QPqKvtqkpJzP7',
);
res = admin_api.invoices.pay(
invoice_id="in_4QPqKvtqkpJzP7",
)
Response bodyJSON
{
"id": "in_4QPqKvtqkpJzP7",
"state": "PAID",
"stateTime": "2025-05-15T13:00:00Z",
"connection": {
"id": "conn_4HdRKnTvPmmjYK",
"displayName": "Stripe",
"state": "ACTIVE",
"type": "STRIPE",
"providers": [],
"view": "BASIC",
"createTime": "2025-05-15T13:00:00Z",
"updateTime": "2025-05-15T13:00:00Z"
},
"externalId": "in_1NrpEGGZpdmtrghC4slAL174",
"number": "ACME-123",
"currencyCode": "USD",
"description": "This is a test.",
"account": {
"fullName": "Jane Doe",
"email": "[email protected]",
"phoneNumber": "+12125550123",
"address": {
"lines": [
"42 West St"
],
"city": "Brooklyn",
"state": "NY",
"postalCode": "11222",
"country": "US"
}
},
"effectiveTime": "2025-05-15T13:00:00Z",
"period": {
"startTime": "2025-05-15T13:00:00Z",
"endTime": "2025-05-15T13:00:00Z"
},
"subtotalAmount": "9",
"discountAmount": "1",
"balance": {
"startAmount": "100",
"endAmount": "200",
"appliedAmount": "-100"
},
"taxAmount": "2",
"dueAmount": "10",
"dueTime": "2025-05-15T13:00:00Z",
"paidAmount": "0",
"items": [
{
"id": "ii_35kH3awC",
"quantity": 2,
"subtotalAmount": "10",
"discountAmount": "1",
"description": "This is a test item.",
"externalId": "ii_456"
}
],
"changes": [],
"view": "FULL",
"createTime": "2025-05-15T13:00:00Z",
"updateTime": "2025-05-15T13:00:00Z"
}