invoices désigne une transaction client (invoice_ar_id, voir GET /api/customers/{code}/unpaid-invoices) et le montant appliqué. Pour appliquer une note de crédit à une facture, comme Acomba : payment_type 3 (remboursement), modes vide, la ligne du crédit en montant négatif (−X) puis la facture (+X) ; les lignes s'équilibrent à 0 $. Le paiement est de la journée courante (current_day: true) tant que la facture n'est pas transférée à la Comptabilité (sinon Acomba refuse : 422, code 119). Un montant refusé par Acomba répond 422 (code 105) avec la ligne en cause (context.line, context.invoice_ar_id).x-api-key: ********************curl --location --globoff 'https://relay.exostack.cloud//api/customers/payments' \
--header 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"customer_id": 1,
"customer_code": "string",
"payment_type": 1,
"payment_date": "2019-08-24T14:15:22.123Z",
"notice_date": "2019-08-24T14:15:22.123Z",
"receivable": 0,
"reference": "string",
"current_day": true,
"modes": [
{
"mode": 0,
"amount": 0
}
],
"invoices": [
{
"invoice_ar_id": 1,
"amount": 0,
"discount": 0
}
]
}'{
"id": 140,
"success": true
}