One customer payment for several invoices, under one number.
POST/v1/remittances
Record remittances: one payment for several invoices
Records a payment the customer is about to make for several invoices under one remittance number of yours. That number is what the payer uses as the card payment's merchant reference or the EFT reference, so when the bank line or the gateway confirmation arrives it finds the remittance waiting and settles every invoice in it. An EFT needs no further call. The lines must add up to the total; with on_account the lines may add up to less (or be none), and the rest settles the customer's open invoices oldest due first. Recording a remittance number that already exists returns it with created false.
Parameters
| Name | In | Required | What it is |
|---|
Idempotency-Key | header | yes | Required on this call. Retrying with the same key returns the original response instead of doing it twice. Reusing a key with a different body is a 422. |
Body a JSON array of these, up to 1 000 per call
| Field | Type | Required | What it is |
|---|
remittance_no | string | yes | |
total | number | yes | What the payer was asked to pay. Positive. |
lines | array of object | yes | |
lines[].invoice_external_ref | string | yes | |
lines[].amount | number | yes | Positive. |
customer_external_ref | string | | |
account_code | string | | Our account code, when customer_external_ref is not sent. |
method | string: EFT, CARD, OZOW, GOOGLE_PAY, APPLE_PAY, OTHER | | How the payer said they would pay. Either route still settles it. Default "EFT". |
on_account | boolean | | What the lines do not take is a payment on account. Default false. |
source_system | string | | Your system's name, the same on every call (for example shop). Identifies your references. |
Answers
201 | count, and remittances with remittance_id, remittance_no and created |
400 | Idempotency-Key header missing, or an empty list |
409 | A request with this Idempotency-Key is already in flight |
413 | More than 1000 remittances in one request |
422 | Incomplete remittance, lines that do not add up to the total, an unknown customer or account, or Idempotency-Key reused with a different body |
Example
curl -X POST 'https://api.reconsmith.com/v1/remittances' \
-H 'Authorization: Bearer $RECONSMITH_KEY' \
-H 'Idempotency-Key: 7c1d0c2e-0b55-4f3a-9a51-1d2f4b6c8e90' \
-H 'Content-Type: application/json' \
-d '[
{
"remittance_no": "string",
"total": 100,
"lines": [
{
"invoice_external_ref": "string",
"amount": 100
}
]
}
]'
GET/v1/remittances/{remittanceNo}
Where a remittance stands
The remittance's status (OPEN, PAID or CANCELLED), method, total, when it was paid, and how many of its invoices are settled and how many are still waiting.
Parameters
| Name | In | Required | What it is |
|---|
remittanceNo | path | yes | Your remittance number, as sent when it was recorded. |
sourceSystem | query | | Your system's name, the same on every call (for example shop). Identifies your references. |
Answers
200 | remittance_no, status, method, total, paid_at, invoices_settled, invoices_waiting |
404 | Unknown remittance |
Example
curl -X GET 'https://api.reconsmith.com/v1/remittances/REMITTANCENO' \
-H 'Authorization: Bearer $RECONSMITH_KEY'
POST/v1/remittances/{remittanceNo}/cancel
Cancel an open remittance
The payer gave up. Marks an OPEN remittance CANCELLED with the reason, so a payment that later arrives under its number is not matched to it. A remittance already paid or cancelled cannot be cancelled.
Parameters
| Name | In | Required | What it is |
|---|
Idempotency-Key | header | yes | Required on this call. Retrying with the same key returns the original response instead of doing it twice. Reusing a key with a different body is a 422. |
remittanceNo | path | yes | Your remittance number, as sent when it was recorded. |
sourceSystem | query | | Your system's name, the same on every call (for example shop). Identifies your references. |
Body
| Field | Type | Required | What it is |
|---|
reason | string | yes | |
Answers
201 | remittance_no, status CANCELLED, reason |
400 | Idempotency-Key header missing |
409 | Unknown, already paid or already cancelled; or a request with this Idempotency-Key is already in flight |
422 | No reason given, or Idempotency-Key reused with a different body |
Example
curl -X POST 'https://api.reconsmith.com/v1/remittances/REMITTANCENO/cancel' \
-H 'Authorization: Bearer $RECONSMITH_KEY' \
-H 'Idempotency-Key: 7c1d0c2e-0b55-4f3a-9a51-1d2f4b6c8e90' \
-H 'Content-Type: application/json' \
-d '{
"reason": "string"
}'
POST/v1/remittances/{remittanceNo}/payment-confirmation
Gateway says the remittance is paid
The gateway's word, not the bank's. Posts the receipt into that gateway's clearing account and spreads it across the remittance's invoices; the bank is untouched until the settlement arrives under the same reference. Idempotent on the gateway reference, so a retried webhook pays nothing twice. Needs a key with the money scope.
Parameters
| Name | In | Required | What it is |
|---|
Idempotency-Key | header | yes | Required on this call. Retrying with the same key returns the original response instead of doing it twice. Reusing a key with a different body is a 422. |
remittanceNo | path | yes | Your remittance number, as sent when it was recorded. |
sourceSystem | query | | Your system's name, the same on every call (for example shop). Identifies your references. |
Body
| Field | Type | Required | What it is |
|---|
gateway_code | string | yes | The payment gateway, as set up for the company. |
amount | number | yes | Gross, as the customer paid it. Fees are handled at settlement. |
gateway_ref | string | | The gateway's reference for the payment. Omit and the remittance number is used. |
method | string | | Default "CARD". |
paid_with | string | | The gateway's payment type, e.g. Visa, Mastercard, MasterPass, EFT_OZOW. Payments the gateway pays out one at a time wait for their own bank line. |
confirmed_at | string (date-time) | | Omit for now. |
merchant_reference | string | | The gateway's merchant reference, kept on the payment for matching the settlement report. |
Answers
201 | remittance_no, gateway_payment_id, status, invoices_settled, invoices_waiting |
400 | Idempotency-Key header missing |
403 | The key may not move money |
404 | Unknown remittance |
409 | A request with this Idempotency-Key is already in flight |
422 | Not confirmed (e.g. unknown gateway, wrong amount, remittance cancelled), or Idempotency-Key reused with a different body |
Example
curl -X POST 'https://api.reconsmith.com/v1/remittances/REMITTANCENO/payment-confirmation' \
-H 'Authorization: Bearer $RECONSMITH_KEY' \
-H 'Idempotency-Key: 7c1d0c2e-0b55-4f3a-9a51-1d2f4b6c8e90' \
-H 'Content-Type: application/json' \
-d '{
"gateway_code": "string",
"amount": 100
}'