A payment is one charge (by card, card wallet, bank account or stablecoin) on a payment link, an invoice or a subscription. Customers create payments at checkout; the API reads them. To give money back, see Refunds; to follow chargebacks, Disputes.
| Topic | Detail |
|---|---|
| Endpoints | `GET /api/v1/payments`, `GET /api/v1/payments/{id}` |
| Key permissions | payments:read |
| Samples | curl; Node.js 18+ with the built-in fetch (in an ES module); the Node SDK (preview: not on npm yet); Python with requests. |
| Every request can also answer | 401 UNAUTHORIZED, 401 API_KEY_EXPIRED, 403 NOT_ENROLLED, 403 PERMISSION_DENIED, 403 IP_NOT_ALLOWED, 429 RATE_LIMITED, 500 INTERNAL_ERROR. See Error codes. |
The payment object
{
"object": "payment",
"livemode": true,
"id": "pay_7Hq2LmX9cR4tVb",
"status": "paid",
"amountCents": 12500,
"amountRefundedCents": 0,
"netCents": 12088,
"currency": "usd",
"description": "Consulting — October",
"source": {
"type": "payment_link",
"id": "pl_4kTz8QwN2xYb6RcD1mPa"
},
"paymentLinkId": "pl_4kTz8QwN2xYb6RcD1mPa",
"customer": {
"name": "Jordan Lee",
"email": "jordan@example.com",
"country": "US"
},
"card": {
"brand": "visa",
"last4": "4242"
},
"paymentMethod": {
"type": "card",
"label": "Visa •••• 4242"
},
"clientReference": "order_1042",
"metadata": {
"campaign": "fall-launch"
},
"amountDetails": {
"subtotalCents": 12500,
"discountCents": 0,
"shippingCents": 0,
"taxCents": 0,
"customerFeeCents": 0
},
"dispute": null,
"failureMessage": null,
"createdAt": "2026-10-14T16:02:11.000Z",
"paidAt": "2026-10-14T16:02:15.000Z"
}| Field | Type | Description |
|---|---|---|
object | string | The type of object. Always payment. |
livemode | boolean | False for test-mode data (an ak_test_ key); true for live data. |
id | string | pay_… |
status | string | paid, pending, failed, canceled, refunded, partially_refunded, disputed: the payment's state now, as Orders shows it. |
amountCents | integer | What the customer paid. Integer cents. |
amountRefundedCents | integer | Refunded so far. Integer cents. |
netCents | integer or null | What you keep after fees, once known; null until then. |
currency | string | Lower-case ISO 4217, e.g. usd. |
description | string | The link's title or Invoice INV-0001. |
source | object | |
source.type | string | One of payment_link, invoice, subscription, manual. |
source.id | string or null | The payment link, invoice or subscription id. |
paymentLinkId | string or null | The payment link it was paid on; null for invoices, subscriptions and manual charges. With metadata, how a shop matches a payment to its order. |
customer | object | |
customer.name | string or null | Billing name. |
customer.email | string | Customer email. |
customer.country | string or null | Billing country, ISO 3166-1 alpha-2. |
paymentMethod | object or null | |
paymentMethod.type | string | card, apple_pay, google_pay, us_bank_account or stablecoin; more may be added. |
paymentMethod.label | string | Visa •••• 4242. |
card | object or null | |
card.brand | string or null | Card network. |
card.last4 | string or null | Last four digits. |
clientReference | string or null | Your own reference, from ?ref= on the link or data-ref on your website's Pay button. |
metadata | object | The payment link's metadata when the payment was made; {} when it had none. |
amountDetails | object | |
amountDetails.subtotalCents | integer or null | Before discount, shipping and fees. Integer cents. |
amountDetails.discountCents | integer | Discount code savings. Integer cents. |
amountDetails.shippingCents | integer | Shipping. Integer cents. |
amountDetails.taxCents | integer | Sales tax. Integer cents. |
amountDetails.customerFeeCents | integer | A surcharge the customer paid. Integer cents. |
dispute | object or null | |
dispute.status | string | One of needs_response, under_review, won, lost, closed. |
failureMessage | string or null | Why the latest attempt failed. |
createdAt | string (date-time) | When the payment was started. |
paidAt | string (date-time) or null | When it went through. |
Endpoints
List payments
/api/v1/paymentspayments:readCard, wallet and bank payments on links, invoices and subscriptions, newest first.
Query
statusstring- Only payments with this status. One of
paid,pending,failed,canceled,refunded,partially_refunded,disputed. createdFromstring- Created at or after: a date such as
2026-10-01(midnight UTC) or an ISO 8601 date-time with its offset, such as2026-10-01T12:00:00Z. createdTostring- Created before (exclusive), in the same format. Must be after
createdFrom. limitinteger- How many objects per page, 1–100. Default 25. See Pagination.
cursorstring- The previous page's
nextCursor, for the page after it.
curl "https://anytime-capital.com/api/v1/payments?status=paid&createdFrom=2026-10-01&createdTo=2026-11-01" \
-H "Authorization: Bearer $ANYTIME_API_KEY"const res = await fetch("https://anytime-capital.com/api/v1/payments?status=paid&createdFrom=2026-10-01&createdTo=2026-11-01", {
headers: { Authorization: `Bearer ${process.env.ANYTIME_API_KEY}` },
});
const page = await res.json();
if (!res.ok) throw new Error(`${page.error.code}: ${page.error.message}`);import { AnytimeCapital } from "@anytimecapital/node";
const client = new AnytimeCapital({ apiKey: process.env.ANYTIME_API_KEY! });
const page = await client.payments.list(
{ status: "paid", createdFrom: "2026-10-01", createdTo: "2026-11-01" },
);import os
import requests
res = requests.get(
"https://anytime-capital.com/api/v1/payments",
headers={"Authorization": f"Bearer {os.environ['ANYTIME_API_KEY']}"},
params={
"status": "paid",
"createdFrom": "2026-10-01",
"createdTo": "2026-11-01",
},
timeout=30,
)
page = res.json()
if not res.ok:
raise RuntimeError(f"{page['error']['code']}: {page['error']['message']}"){
"object": "list",
"data": [
{
"object": "payment",
"livemode": true,
"id": "pay_7Hq2LmX9cR4tVb",
"status": "paid",
"amountCents": 12500,
"amountRefundedCents": 0,
"netCents": 12088,
"currency": "usd",
"description": "Consulting — October",
"source": {
"type": "payment_link",
"id": "pl_4kTz8QwN2xYb6RcD1mPa"
},
"paymentLinkId": "pl_4kTz8QwN2xYb6RcD1mPa",
"customer": {
"name": "Jordan Lee",
"email": "jordan@example.com",
"country": "US"
},
"card": {
"brand": "visa",
"last4": "4242"
},
"paymentMethod": {
"type": "card",
"label": "Visa •••• 4242"
},
"clientReference": "order_1042",
"metadata": {
"campaign": "fall-launch"
},
"amountDetails": {
"subtotalCents": 12500,
"discountCents": 0,
"shippingCents": 0,
"taxCents": 0,
"customerFeeCents": 0
},
"dispute": null,
"failureMessage": null,
"createdAt": "2026-10-14T16:02:11.000Z",
"paidAt": "2026-10-14T16:02:15.000Z"
}
],
"hasMore": true,
"nextCursor": "pay_7Hq2LmX9cR4tVb"
}Errors
- 400
INVALID_INPUT - A field, filter,
limitorcursoris missing or invalid. The message starts with the field's name, as inamountCents: …, or readsInvalid cursor.Fix the named field. Don't retry the same request unchanged.
Get a payment
/api/v1/payments/{id}payments:readOne payment by id.
Path
idstringrequired- The payment's id,
pay_….
curl https://anytime-capital.com/api/v1/payments/pay_7Hq2LmX9cR4tVb \
-H "Authorization: Bearer $ANYTIME_API_KEY"const res = await fetch("https://anytime-capital.com/api/v1/payments/pay_7Hq2LmX9cR4tVb", {
headers: { Authorization: `Bearer ${process.env.ANYTIME_API_KEY}` },
});
const payment = await res.json();
if (!res.ok) throw new Error(`${payment.error.code}: ${payment.error.message}`);import { AnytimeCapital } from "@anytimecapital/node";
const client = new AnytimeCapital({ apiKey: process.env.ANYTIME_API_KEY! });
const payment = await client.payments.retrieve("pay_7Hq2LmX9cR4tVb");import os
import requests
res = requests.get(
"https://anytime-capital.com/api/v1/payments/pay_7Hq2LmX9cR4tVb",
headers={"Authorization": f"Bearer {os.environ['ANYTIME_API_KEY']}"},
timeout=30,
)
payment = res.json()
if not res.ok:
raise RuntimeError(f"{payment['error']['code']}: {payment['error']['message']}"){
"object": "payment",
"livemode": true,
"id": "pay_7Hq2LmX9cR4tVb",
"status": "paid",
"amountCents": 12500,
"amountRefundedCents": 0,
"netCents": 12088,
"currency": "usd",
"description": "Consulting — October",
"source": {
"type": "payment_link",
"id": "pl_4kTz8QwN2xYb6RcD1mPa"
},
"paymentLinkId": "pl_4kTz8QwN2xYb6RcD1mPa",
"customer": {
"name": "Jordan Lee",
"email": "jordan@example.com",
"country": "US"
},
"card": {
"brand": "visa",
"last4": "4242"
},
"paymentMethod": {
"type": "card",
"label": "Visa •••• 4242"
},
"clientReference": "order_1042",
"metadata": {
"campaign": "fall-launch"
},
"amountDetails": {
"subtotalCents": 12500,
"discountCents": 0,
"shippingCents": 0,
"taxCents": 0,
"customerFeeCents": 0
},
"dispute": null,
"failureMessage": null,
"createdAt": "2026-10-14T16:02:11.000Z",
"paidAt": "2026-10-14T16:02:15.000Z"
}Errors
- 404
NOT_FOUND - No such object on your business (an id from another business reads the same), or no such endpoint under
/api/v1, which still answers in JSON. Check the id and the path. Ids are case-sensitive.