Billing
Get credit notes
This endpoint retrieves credit note data for specified credit note IDs, with options for PDF or CSV export.
Request
Method: GET
URL: https://api.sandbox.bobpay.co.za/v2/billing/credit-notes
Query parameters
| Key | Description | Type | Required |
|---|---|---|---|
| id | Filter for a specific credit note ID. | integer | Conditional (if pdf=true) |
| ids | A comma-separated list or array of credit note IDs to retrieve. | integer or array | No |
| account_id | The unique identifier of the account whose credit notes are being requested. | integer | No |
Boolean flag to return a PDF download link instead of the credit note data. Only takes effect when id is specified. |
boolean | No | |
| csv | Boolean flag. If true, the CSV is generated in the background and emailed to the authenticated user. | boolean | No |
Response
Status code: 200 OK Content-Type: application/json
Response body (download PDF URL)
{
"credit_notes": null,
"download_url": {
"url": "https://payments-backend-dev-infra-billing.s3.af-south-1.amazonaws.com/pdfs/credit_note_531.pdf?...",
"filename": "pdfs/credit_note_531.pdf",
"bucket": "payments-backend-dev-infra-billing",
"file_size": 56137
},
"count": 1
}
Response fields
| Key | Description | Type |
|---|---|---|
| credit_notes | An array containing the retrieved credit note objects, or null when a PDF is requested. | array of objects |
| id | The unique identifier for the credit note. | integer |
| account_id | The account associated with the credit note. | integer |
| credit_note_date | The date the credit note was issued. | string (datetime) |
| sub_total | The subtotal amount before VAT/tax. | float |
| vat | The VAT amount credited. | float |
| vat_percentage | The VAT percentage rate applied. | float |
| total_amount | The total amount of the credit note (including VAT, if applicable). | float |
| time_created | Timestamp when the credit note was created. | string (datetime) |
| time_modified | Timestamp when the credit note was last modified. | string (datetime) |
| metadata | Object containing additional information (issuer details, billing info, etc.). | object |
| credit_note_items | Array of items credited in the credit note. | array of objects |
| validated | Additional validation status or information. | string |
| download_url | Object containing download link and metadata if pdf=true. | object |
| count | The total number of credit notes or downloads returned in the response. | integer |
Note:
- The
metadataobject includes issuer, account, and billing info, whilecredit_note_itemslists each credited item and its details. - When requesting a PDF (
pdf=true), thedownload_urlobject is returned in place of the credit notes array.