riverty logo

Docs

Create an Invoice

Path

POST /v1/clients/{clientId}/partner-subscriptions/{subscriptionId}/invoices

Request Parameters

Idempotency-Key
string
The `idempotency-key` header is an optional field that can be included in requests to ensure request idempotence. This key serves as a unique identifier for each request, preventing the same request from being processed multiple times. For best practices, it's recommended to use UUIDs (Universally Unique Identifiers) as idempotency keys.
clientId
required
integer
Your assigned `ClientId`.
subscriptionId
required
string
Id of the subscription.

Request Body

application/json

periodId
required
string
> 100 Characters
required
array
The lines of the invoice.
array
A list of key-value pairs.

Responses

Successful RequestUnsuccessful Request, Incorrect/Missing Information

Request Example

    
        {
 "periodId": "period-id-1",
 "invoiceLines": [
  {
   "productId": "product-id-1",
   "description": "Home services, Internet 100M / 25M, monthly fee",
   "imageUrl": "https://telecommunicationcompany.com/images/internet-100-25.png",
   "grossAmount": 39.99,
   "vatPercentage": 20,
   "unit": {
    "netPrice": 33.325,
    "quantity": 1,
    "code": "PCS"
   },
   "metaData": [
    {
     "key": "order-id",
     "value": "a9ee9996-e941-4aa8-90b9-4b047c4afe87"
    }
   ]
  }
 ],
 "metadata": [
  {
   "key": "invoice-custom-data",
   "value": "3937501"
  }
 ]
}
    

Response Example

    
        {
 "invoiceNumber": "PF100001",
 "_links": [
  {
   "method": "GET",
   "href": "https://api.riverty.io/partner-financing/v1/clients/1234/partner-subscriptions/subscription-id-1/invoices/PF100001",
   "rel": "self",
   "target": "API"
  },
  {
   "method": "GET",
   "href": "https://consumer.riverty.io/p/apgD/24pOlNDL7zKrKzjzF5ba",
   "rel": "manage-payments",
   "target": "BROWSER"
  }
 ]
}