Skip to navigation

Migrate from the legacy API

The legacy api.agentpaid.io API keeps working while you move, and won’t change in ways that break your integration. New resources and dated versions ship on https://api.paid.ai/v1. This guide lists what changes when you move an integration across.

Prerequisites

  • Have your API key ready. The same key works on both hosts.
  • If your network allowlists outbound domains, add api.paid.ai.

Change the base URL

Replace the legacy base URL with the new one. The /api/ segment is gone, and the path version is /v1.

LegacyNew
https://api.agentpaid.io/api/v2/...https://api.paid.ai/v1/...

Resources move to /v1 as they are released. Until a resource appears in the API reference, keep calling it on the legacy host. The two hosts share the same account and data, so you can move one resource at a time.

Pin a version

Requests to /v1 use your account’s pinned dated version. Send Paid-Version on every request to make your integration independent of the pin:

curl https://api.paid.ai/v1/api-version \
-H "Authorization: Bearer $PAID_API_KEY" \
-H "Paid-Version: 2026-11-01"

Update error handling

Legacy errors are a flat object. On /v1, every error is a standard object under error, with a stable type and code:

Legacy
{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"details": "version: Required"
}
v1
{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "version: Required",
"requestId": "req_3f1c0b9e-2a7d-4c5e-9f61-0d8e4b2a7c13",
"docUrl": "https://docs.paid.ai/preview/developers/api/errors#validation_error"
}
}
  • Branch on error.type for the category and error.code for the specific case. Codes are lowercase.
  • error.param names the field or header at fault, when there is one.
  • error.requestId matches the Request-Id response header. Include it when contacting support.

Use betas instead of experimental resources

Legacy resources with -experimental in their names have no -experimental twin on /v1. Early access uses the Paid-Beta header instead, so the resource keeps its final name. See Use a beta.

Retry safely

POST and PATCH requests on /v1 accept an Idempotency-Key header: 1 to 255 printable ASCII characters, with no spaces. Retrying with the same key and body within 24 hours returns the original response, marked with Idempotent-Replayed: true, instead of repeating the operation.

Move customers

The customers resource on /v1 is in the customers=v1 private beta. Send Paid-Beta: customers=v1 on every customer request.

  • One path for both IDs. /v1/customers/{customer} takes the cus_ ID, your externalId, or an alias, so the /external/{externalId} routes have no /v1 equivalent.
  • Update is PATCH. It changes only the fields you send. Send null to clear a field.
  • Archive, don’t delete. POST /v1/customers/{customer}/archive replaces DELETE. It fails with customer_has_active_orders while the customer has an open order.
  • Cursor pagination. Lists return { object: "list", data, hasMore, nextCursor }. Send nextCursor back as cursor instead of an offset.
Legacy field/v1 field
id ("" when missing)id, always a cus_ ID
email, phone, website ("" when not set)The same names, null when not set
billingAddressaddress
billingAddress.zipCodeaddress.postalCode
defaultCurrency (USD)currency (usd), validated against your account’s currencies
vatNumbertaxIds: [{ type, value }]
creationState and statusstatus (draft or active)
churnDatechurnedAt
connections.stripe.customerIdNot returned
(none)object, livemode, archivedAt