Custom Payment Settlements
Vendor payments can usually be settled manually or upon specific events happening within Onport's platform (e.g. after shipping).
However, some custom integrations may require an external system to perform a payment settlement. This could be a bi-weekly job to generate transfers against a given dropship Provider Id or set of ids.
The following cURL request settles a transfer for an array of invoices specified in the toPay array.
curl --request POST \--url https://api.jetti.io/api/dropship-providers/:id/settle-transfer.json \--header 'Authorization: Bearer {{token}}' \--header 'Content-Type: application/json' \--data '{"toPay":[id],"additionalAmount":0,"name":"name","paymentMethodId":id}'
The paymentMethodId will need to match one of the payment method Ids available at https://app.jetti.io/payment-methods. Once you open the single Payment Method, you will be able to find the Id in the URL bar.
Asynchronous Endpoint Usage
Alternatively, there's the asynchronous endpoint settle-transfer-async.json, which accepts the same data:
curl --request POST \--url https://api.jetti.io/api/dropship-providers/:id/settle-transfer-async.json \--header 'Authorization: Bearer {{token}}' \--header 'Content-Type: application/json' \--data '{"toPay":[id],"additionalAmount":0,"name":"name","paymentMethodId":id}'
The key difference is that this endpoint immediately returns a 200 status code, indicating that the message was enqueued, and will be processed in the background.
This approach is particularly useful when dropship providers have a large number of invoices to process.
In some cases, due to the 30-second timeout of our load balancer, we sometimes can't process everything in time, leading to 500 or 504 errors.
To avoid these issues, we recommend using this asynchronous endpoint.