Payments API (/coupa_pay/payments )
Overview
Coupa Pay Invoice Payments may be retrieved from Coupa by another system like your ERP using a GET request sent to the Payments API endpoint: https://<your_instance_name>/api/coupa_pay/payments
Once an invoice payment is exported for accounting to an ERP, that payment should be marked as "exported": true,
using the PUT call, so it is not retrieved a second time.
API operations supported:
- GET
- PUT (only to mark exported)
The API key used to fetch/update data must have permission to index, show, and update ../api/coupa_pay/payments
data.
Payment data can be queried by all fields within the payload. Typical query parameters are:
- ?exported=false
- ?payment-partner[issuing-bank]=<Bank_Name>
- ?status=approved
- ?status[in]=payment_initiated,completed_with_errors
- ?pay_to_account[type]=CoupaPay::SupplierPaymentAccount (to pull only Invoice Payments, not Expense Payments)
- ?updated-at[gt]<date-time> (NOTE: use update-at to make sure all payment status change captured)
Query parameters can be combined into a call statement like the following:
-
API GET
-
https://<your_instance_name>/api/coupa_pay/payments?status[in]=completed_successfully,completed_with_errors&exported=false&payment-partner[issuing-bank]=XYZBank&pay_to_account[type]=CoupaPay::SupplierPaymentAccount
- This will return Invoice payments with status of "
completed_successfully
" & "completed_with_errors
" for XYZBank Issuer Payment Partner that are approved but not yet exported
- This will return Invoice payments with status of "
-
https://<your_instance_name>/api/coupa_pay/payments/?status[in]=payment_initiated,completed_with_errors&updated-at[gt]=2019-07-18T13:33:00-07:00&pay_to_account[type]=CoupaPay::SupplierPaymentAccount
-
This will return all Invoice payments updated since 2019-07-18T13:33:00-07:00 with status “payment_initiated” and “completed_with_errors”
-
Date input should be taken from Middleware last integration execution date/time to ensure only new/updated payments are pulled from Coupa.
-
-
An exported payment should be marked as exported once it is fetched successfully. You can do that with a call like the following:
-
API PUT
https://<your_instance_name>/api/coupa_pay/payments/<ID>?exported=true
OR -
API PUT
https://<your_instance_name>/api/coupa_pay/payments/<ID>
with a payload like:-
<coupa-pay-payment><exported>true</exported></coupa-pay-payment>
-
Elements
Name | Description | Required | Unique | Allowable Values | In | Out | Data Type | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | Coupa unique payment identifier | Yes | yes | integer | |||||||||||||||||||||
created-at | Automatically created by Coupa in the format YYYY-MM-DDTHH:MM:SS+HH:MMZ | yes | datetime | ||||||||||||||||||||||
updated-at | Automatically created by Coupa in the format YYYY-MM-DDTHH:MM:SS+HH:MMZ | yes | datetime | ||||||||||||||||||||||
line-num | Line number |
yes | integer | ||||||||||||||||||||||
external-ref-id | Reference id set by payment provider | yes | integer | ||||||||||||||||||||||
status | Payment Status (payment_initiated; payment_in_progress, completed_successfully;completed_with_errors) | draft, approved, payment initiated, payment_in_progress, completed_successfully, completed_with_errors | yes | string | |||||||||||||||||||||
exported |
Was the line exported previously to a third party system? Used by integration to find new values. |
true, false | yes | boolean | |||||||||||||||||||||
last-exported-at | Timestamp in the format: YYYY-MM-DDTHH:MM:SS+HH:MMZ | datetime | |||||||||||||||||||||||
payment-batch-id | Payment Batch Identifier Invoice Coupa ID Invoice Number Total Amount Currency Pay from account details Pay to account details |
integer | |||||||||||||||||||||||
pay-from-total | decimal | ||||||||||||||||||||||||
pay-to-total | decimal | ||||||||||||||||||||||||
reporting-pay-from-total | decimal | ||||||||||||||||||||||||
reporting-pay-to-total | |||||||||||||||||||||||||
exchange-rate | |||||||||||||||||||||||||
error-text | string | ||||||||||||||||||||||||
payment-details | Key Data Elements
|
Payment Details array | |||||||||||||||||||||||
pay-from-account | Account | ||||||||||||||||||||||||
pay-to-account | Account | ||||||||||||||||||||||||
pay-from-currency | |||||||||||||||||||||||||
pay-to-currency | |||||||||||||||||||||||||
reporting-currency | |||||||||||||||||||||||||
payee | supplier array | ||||||||||||||||||||||||
payment-batch | payment-batch array | ||||||||||||||||||||||||
created-by | User who created | yes | User | ||||||||||||||||||||||
updated-by | User who updated | yes | User |