Rápido Pagos
Subscriptions

Get an invoice

GET
/invoice/{id}

Retrieves an invoice of a subscription with its lines, its payments and their refunds.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key of the organization the request acts for, created in the dashboard and sent as "Authorization: Bearer ".

Path Parameters

id*string

The ID of the invoice

Formatuuid
Example"3c8a1f5e-7b2d-4e9a-8c6f-1d0b5a7e9f24"

Response Body

The invoice

application/json
  1. response

An invoice of a subscription. Amounts are in cents of the subscription currency, ITBIS included, except chargedAmount, which is in DOP cents.

id*string
Formatuuid
Example"3c8a1f5e-7b2d-4e9a-8c6f-1d0b5a7e9f24"
subscriptionId*string
Formatuuid
Example"9b2e7c41-5d8a-4f3e-b6c1-0a4d2e8f7b19"
reason*string
Value in"subscription-start""trial-end""renewal""update""resume"
status*string
Value in"open""paid""void""uncollectible"
subtotal*integer
itbis*integer
creditApplied*integer
total*integer
exchangeRate*|

The pesos per dollar that converted a USD invoice into chargedAmount, or null for a DOP invoice

chargedAmount*integer

What each attempt charges, in DOP cents

periodStart*string
Formatdate-time
periodEnd*string
Formatdate-time
attemptCount*integer

How many attempts the invoice has counted

nextAttemptAt*|

When the next sale is due, or null when none is

Formatdate-time
lastIsoCode*|

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.

Formatdate-time
heldReason*|

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

Value in"unknown-sale""processor-setup"null
heldAt*|

When the invoice was held

Formatdate-time
paidAt*|
Formatdate-time
pendingChange*|

The change that applies once an update invoice is paid

lines*array<>
payments*array<>
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Get an invoice
curl -X GET 'https://api.rapidopagos.com/invoice/3c8a1f5e-7b2d-4e9a-8c6f-1d0b5a7e9f24'
Example Response
{  "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"}