PowerBuilder / Coupa Postman Collection - OAuth - Master / Get All Payments in a specific Invoice Payment Batch by Payment Batch ID
Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_QueryParams
oleobject loo_Resp
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_QueryParams = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_QueryParams.ConnectToNewObject("Chilkat.JsonObject")
loo_QueryParams.UpdateInt("payment-batch-id",2873)
loo_QueryParams.UpdateString("pay_to_account[type]","CoupaPay::SupplierPaymentAccount")
loo_QueryParams.UpdateString("fields","[~"id~",~"payment-batch-id~",~"status~",~"exchange_rate~",~"updated_at~",~"released_at~",{~"pay_from_account~":[~"id~",{~"currency~":[~"code~"]}]},{~"pay_to_currency~":[~"code~"]},{~"payee~":[~"number~"]},{~"digital_check~":[~"check_number~"]},{~"payment_details~":[~"id~",~"released_at~",~"source_transaction_id~",~"source_transaction_reference~",~"discount_total~",~"payment_total~",{~"payable_allocations~":[~"id~",~"updated_at~",~"payable_to_amount~",~"source_transaction_to_reference~",~"source_transaction_to_id~"]},{~"currency~":[~"code~"]}]}]")
// Adds the "Authorization: Bearer <access_token>" header.
loo_Http.AuthToken = "<access_token>"
loo_Resp = loo_Http.QuickRequestParams("GET","https://domain.com/coupa_pay/payments",loo_QueryParams)
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_QueryParams
return
end if
Write-Debug string(loo_Resp.StatusCode)
Write-Debug loo_Resp.BodyStr
destroy loo_Resp
destroy loo_Http
destroy loo_QueryParams
Curl Command
curl -G -d "payment-batch-id=2873"
-d "pay_to_account[type]=CoupaPay%3A%3ASupplierPaymentAccount"
-d "fields=%5B%22id%22,%22payment-batch-id%22,%22status%22,%22exchange_rate%22,%22updated_at%22,%22released_at%22,%7B%22pay_from_account%22%3A%5B%22id%22,%7B%22currency%22%3A%5B%22code%22%5D%7D%5D%7D,%7B%22pay_to_currency%22%3A%5B%22code%22%5D%7D,%7B%22payee%22%3A%5B%22number%22%5D%7D,%7B%22digital_check%22%3A%5B%22check_number%22%5D%7D,%7B%22payment_details%22%3A%5B%22id%22,%22released_at%22,%22source_transaction_id%22,%22source_transaction_reference%22,%22discount_total%22,%22payment_total%22,%7B%22payable_allocations%22%3A%5B%22id%22,%22updated_at%22,%22payable_to_amount%22,%22source_transaction_to_reference%22,%22source_transaction_to_id%22%5D%7D,%7B%22currency%22%3A%5B%22code%22%5D%7D%5D%7D%5D"
-H "Authorization: Bearer <access_token>"
https://domain.com/coupa_pay/payments
Postman Collection Item JSON
{
"name": "Get All Payments in a specific Invoice Payment Batch by Payment Batch ID",
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{URL}}/coupa_pay/payments?payment-batch-id=2873&pay_to_account[type]=CoupaPay::SupplierPaymentAccount&fields=[\"id\",\"payment-batch-id\",\"status\",\"exchange_rate\",\"updated_at\",\"released_at\",{\"pay_from_account\":[\"id\",{\"currency\":[\"code\"]}]},{\"pay_to_currency\":[\"code\"]},{\"payee\":[\"number\"]},{\"digital_check\":[\"check_number\"]},{\"payment_details\":[\"id\",\"released_at\",\"source_transaction_id\",\"source_transaction_reference\",\"discount_total\",\"payment_total\",{\"payable_allocations\":[\"id\",\"updated_at\",\"payable_to_amount\",\"source_transaction_to_reference\",\"source_transaction_to_id\"]},{\"currency\":[\"code\"]}]}]",
"host": [
"{{URL}}"
],
"path": [
"coupa_pay",
"payments"
],
"query": [
{
"key": "payment-batch-id",
"value": "2873"
},
{
"key": "pay_to_account[type]",
"value": "CoupaPay::SupplierPaymentAccount"
},
{
"key": "fields",
"value": "[\"id\",\"payment-batch-id\",\"status\",\"exchange_rate\",\"updated_at\",\"released_at\",{\"pay_from_account\":[\"id\",{\"currency\":[\"code\"]}]},{\"pay_to_currency\":[\"code\"]},{\"payee\":[\"number\"]},{\"digital_check\":[\"check_number\"]},{\"payment_details\":[\"id\",\"released_at\",\"source_transaction_id\",\"source_transaction_reference\",\"discount_total\",\"payment_total\",{\"payable_allocations\":[\"id\",\"updated_at\",\"payable_to_amount\",\"source_transaction_to_reference\",\"source_transaction_to_id\"]},{\"currency\":[\"code\"]}]}]"
}
]
}
},
"response": [
]
}