Create Refund for a Specific Credit Note: /credit-notes/{credit_note_id}/refunds
Purpose
This endpoint create a new refund against a specific credit note. It records refund details such as amount, reference, payment method, and additional metadata to ensure accurate financial tracking.
Use Case
This endpoint is used when a refund needs to be issued against a credit note. For example, if a customer has been overcharged or returned goods, the system can create a refund linked to the original credit note, ensuring proper reconciliation of accounts.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| credit_note_id | String | The unique identifier of the credit note against which the refund is created. |
Query Parameters
This endpoint does not have any query parameters.
Request Body
The request body must include refund details such as ID, amount, reference, payment method, and other optional attributes. This ensures the refund is correctly recorded and linked to the specified credit note.
{
"refund": {
"id": "REFUND_ID",
"date": "TIMESTAMP",
"amount": "NUMBER",
"reference": "REFUND_REFERENCE",
"note": "REFUND_NOTE",
"payment_method": "PAYMENT_METHOD",
"payment_processor": "PAYMENT_PROCESSOR",
"effective_date": "TIMESTAMP"
}
}
| Attribute | Type | Description |
|---|---|---|
| id | String | The unique identifier of the refund. |
| date | String | The date the refund is created (format: YYYY-MM-DD). |
| amount | String | The amount to be refunded. |
| reference | String | A reference number or note for the refund. |
| note | String | Additional notes for the refund. |
| payment_method | String | The method used to process the refund (example: Cheque, Cash). |
| payment_processor | String | The processor handling the refund transaction. |
| effective_date | String | The date when the refund becomes effective. |
| custom_attributes | Array | A list of custom attributes (name/value pairs) for additional metadata. |
Response
The API endpoint successfully returns the full refund details created against the credit note, including its status, amount, payment method, and metadata. It also provides audit information such as created by, created on, and UUID for tracking purposes.
Response Body
{
"refund": {
"status": "STATUS",
"id": "REFUND_ID",
"amount": "NUMBER",
"reference": "REFERENCE_ID",
"note": "EMPTY",
"payment_method": "PAYMENT_METHOD",
"payment_processor": "PAYMENT_PROCESSOR",
"gateway_response": "EMPTY",
"credit_note_id": "CREDIT_NOTE_ID",
"custom_attributes": [
{
"name": "ATTRIBUTE_NAME",
"value": "EMPTY"
}
],
"version": "VERSION",
"created_by": "CREATED_BY",
"created_on": "TIMESTAMP",
"last_updated_by": "EMPTY",
"last_updated_on": "TIMESTAMP",
"uuid": "UUID"
}
}
| Attribute | Type | Description |
|---|---|---|
| status | String | Status of the refund (example: ACTIVE). |
| id | String | Unique identifier of the refund. |
| amount | String | Amount refunded. |
| reference | String | Reference code for the refund. |
| note | String | Additional note for the refund. |
| payment_method | String | Method used for refund (example: Cheque). |
| payment_processor | String | Processor handling the refund. |
| gateway_response | String | Response from the payment gateway (if applicable). |
| credit_note_id | String | The credit note ID associated with the refund. |
| custom_attributes | Array | List of custom attributes (name/value pairs). |
| version | String | Version of the refund record. |
| created_by | String | User who created the refund. |
| created_on | String | Timestamp when the refund was created. |
| last_updated_by | String | User who last updated the refund. |
| last_updated_on | String | Timestamp when the refund was last updated. |
| uuid | String | Unique system identifier for the refund. |