Openapi
Allocate one payment or credit to several documents. A replay of the same reference adds nothing.
sb-auth-token<token>Supabase browser session cookie. Supabase may split larger session values into chunked cookies like sb-auth-token.0.
organizationId*stringuuidThe payment and its allocations.
application/jsonallocations*array<>1 <= itemsamount*integer0 < valuecurrency*string3 <= length <= 3method?string1 <= length <= 50note?string1 <= length <= 500partyId*stringuuidreceivedOn?stringdatereference*string1 <= length <= 100side*string"customer""customer""supplier"source*string"payment""payment""credit"Returns the result.
application/jsonallocated*minorUnitsallocations*array<>credited*minorUnits|nullcurrency*stringdiscount*minorUnitspartyId*stringuuidreference*stringcurl -X POST 'https://app.localhost/api/v1/organizations/123/payment-allocations' \ -H 'Content-Type: application/json' \ -d '{ "allocations": [ { "amount": 1, "invoiceId": "4f163819-178d-470c-a246-d6768476a6ec", "takeDiscount": true } ], "amount": 1, "currency": "str", "partyId": "950a3d1f-4657-4e7b-87db-3ff5fa95b5c0", "reference": "string", "side": "customer", "source": "payment"}'{ "allocated": 0, "allocations": [ { "allocatedOn": "2019-08-24", "amount": 0, "currency": "string", "discount": 0, "invoiceId": "4f163819-178d-470c-a246-d6768476a6ec", "paymentId": "472e651e-5a1e-424d-8098-23858bf03ad7", "reference": "string", "source": "payment", "unallocated": true } ], "credited": 0, "currency": "string", "discount": 0, "partyId": "950a3d1f-4657-4e7b-87db-3ff5fa95b5c0", "reference": "string"}