Get an invoice
Retrieves an invoice of a subscription with its lines, its payments and their refunds.
apiKeyAuthorizationBearer <token>An API key of the organization the request acts for, created in the dashboard and sent as "Authorization: Bearer ".
id*stringThe ID of the invoice
uuid"3c8a1f5e-7b2d-4e9a-8c6f-1d0b5a7e9f24"The invoice
application/json- response
An invoice of a subscription. Amounts are in cents of the subscription currency, ITBIS included, except chargedAmount, which is in DOP cents.
id*stringuuid"3c8a1f5e-7b2d-4e9a-8c6f-1d0b5a7e9f24"subscriptionId*stringuuid"9b2e7c41-5d8a-4f3e-b6c1-0a4d2e8f7b19"reason*string"subscription-start""trial-end""renewal""update""resume"status*string"open""paid""void""uncollectible"subtotal*integeritbis*integercreditApplied*integertotal*integerexchangeRate*|The pesos per dollar that converted a USD invoice into chargedAmount, or null for a DOP invoice
chargedAmount*integerWhat each attempt charges, in DOP cents
periodStart*stringdate-timeperiodEnd*stringdate-timeattemptCount*integerHow many attempts the invoice has counted
nextAttemptAt*|When the next sale is due, or null when none is
date-timelastIsoCode*|The code of the latest declined sale
collectionStartedAt*|When the collection window started: the first failure, or the release of a hold. The window ends 21 days later.
date-timeheldReason*|Why no sale runs on the invoice until an operator releases it: unknown-sale when the outcome of a sale is unknown, processor-setup after a setup error on our side
"unknown-sale""processor-setup"nullheldAt*|When the invoice was held
date-timepaidAt*|date-timependingChange*|The change that applies once an update invoice is paid
lines*array<>payments*array<>createdAt*stringdate-timeupdatedAt*stringdate-timecurl -X GET 'https://api.rapidopagos.com/invoice/3c8a1f5e-7b2d-4e9a-8c6f-1d0b5a7e9f24'{ "id": "3c8a1f5e-7b2d-4e9a-8c6f-1d0b5a7e9f24", "subscriptionId": "9b2e7c41-5d8a-4f3e-b6c1-0a4d2e8f7b19", "reason": "subscription-start", "status": "open", "subtotal": 0, "itbis": 0, "creditApplied": 0, "total": 0, "exchangeRate": "string", "chargedAmount": 0, "periodStart": "2019-08-24T14:15:22Z", "periodEnd": "2019-08-24T14:15:22Z", "attemptCount": 0, "nextAttemptAt": "2019-08-24T14:15:22Z", "lastIsoCode": "string", "collectionStartedAt": "2019-08-24T14:15:22Z", "heldReason": "unknown-sale", "heldAt": "2019-08-24T14:15:22Z", "paidAt": "2019-08-24T14:15:22Z", "pendingChange": { "items": [ { "productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113", "quantity": 0, "unitAmount": 0, "unitItbis": 0 } ], "recurringInterval": "week", "billingAnchor": "2019-08-24T14:15:22Z" }, "lines": [ { "productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113", "description": "string", "quantity": 0, "unitAmount": 0, "unitItbis": 0, "amount": 0, "itbis": 0, "periodStart": "2019-08-24T14:15:22Z", "periodEnd": "2019-08-24T14:15:22Z", "proration": true } ], "payments": [ { "paymentId": "472e651e-5a1e-424d-8098-23858bf03ad7", "processorReference": "string", "chargedAmount": 0, "approvedAt": "2019-08-24T14:15:22Z", "refunds": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "amount": 0, "itbis": 0, "kind": "refund", "status": "pending", "createdAt": "2019-08-24T14:15:22Z" } ] } ], "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}Create a checkout for a subscription's open invoice POST
Creates a checkout that lets the customer pay the subscription's open invoice by card, for the invoice's amounts. The sale runs with 3D Secure and saves the card. The checkout takes no wallet and expires 24 hours after its creation, and its outcome reaches the organization's webhook endpoint as invoice and subscription events. While a checkout of the invoice still waits for payment details, the route answers 200 with that checkout and creates no other.
List a subscription's invoices GET
Lists the invoices of a subscription newest first, 25 per page.