ReconSmiths Developers Your API keys

Reference

Remittances

One customer payment for several invoices, under one number.

This page as plain text: remittances.md

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

NameInRequiredWhat it is
Idempotency-KeyheaderyesRequired 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

FieldTypeRequiredWhat it is
remittance_nostringyes
totalnumberyesWhat the payer was asked to pay. Positive.
linesarray of objectyes
lines[].invoice_external_refstringyes
lines[].amountnumberyesPositive.
customer_external_refstring
account_codestringOur account code, when customer_external_ref is not sent.
methodstring: EFT, CARD, OZOW, GOOGLE_PAY, APPLE_PAY, OTHERHow the payer said they would pay. Either route still settles it. Default "EFT".
on_accountbooleanWhat the lines do not take is a payment on account. Default false.
source_systemstringYour system's name, the same on every call (for example shop). Identifies your references.

Answers

201count, and remittances with remittance_id, remittance_no and created
400Idempotency-Key header missing, or an empty list
409A request with this Idempotency-Key is already in flight
413More than 1000 remittances in one request
422Incomplete 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

NameInRequiredWhat it is
remittanceNopathyesYour remittance number, as sent when it was recorded.
sourceSystemqueryYour system's name, the same on every call (for example shop). Identifies your references.

Answers

200remittance_no, status, method, total, paid_at, invoices_settled, invoices_waiting
404Unknown 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

NameInRequiredWhat it is
Idempotency-KeyheaderyesRequired 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.
remittanceNopathyesYour remittance number, as sent when it was recorded.
sourceSystemqueryYour system's name, the same on every call (for example shop). Identifies your references.

Body

FieldTypeRequiredWhat it is
reasonstringyes

Answers

201remittance_no, status CANCELLED, reason
400Idempotency-Key header missing
409Unknown, already paid or already cancelled; or a request with this Idempotency-Key is already in flight
422No 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

NameInRequiredWhat it is
Idempotency-KeyheaderyesRequired 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.
remittanceNopathyesYour remittance number, as sent when it was recorded.
sourceSystemqueryYour system's name, the same on every call (for example shop). Identifies your references.

Body

FieldTypeRequiredWhat it is
gateway_codestringyesThe payment gateway, as set up for the company.
amountnumberyesGross, as the customer paid it. Fees are handled at settlement.
gateway_refstringThe gateway's reference for the payment. Omit and the remittance number is used.
methodstringDefault "CARD".
paid_withstringThe 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_atstring (date-time)Omit for now.
merchant_referencestringThe gateway's merchant reference, kept on the payment for matching the settlement report.

Answers

201remittance_no, gateway_payment_id, status, invoices_settled, invoices_waiting
400Idempotency-Key header missing
403The key may not move money
404Unknown remittance
409A request with this Idempotency-Key is already in flight
422Not 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
}'