Back to Collection Items
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.
$http = New-Object Chilkat.Http
$queryParams = New-Object Chilkat.JsonObject
$queryParams.UpdateString("status[in]","completed_successfully,completed_with_errors")
$queryParams.UpdateString("exported","false")
$queryParams.UpdateString("pay_to_account[type]","CoupaPay::EmployeePaymentAccount")
$queryParams.UpdateString("fields","[`"id`",`"payment-batch-id`",`"status`",`"exchange_rate`",`"updated_at`",{`"pay_from_account`":[`"id`",{`"currency`":[`"code`"]}]},{`"pay_to_currency`":[`"code`"]},{`"payee`":[`"number`"]},{`"digital_check`":[`"check_number`"]},{`"payment_details`":[`"id`",`"updated_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.
$http.AuthToken = "<access_token>"
$resp = $http.QuickRequestParams("GET","https://domain.com/coupa_pay/payments",$queryParams)
if ($http.LastMethodSuccess -eq $false) {
$($http.LastErrorText)
exit
}
$($resp.StatusCode)
$($resp.BodyStr)
Curl Command
curl -G -d "status[in]=completed_successfully,completed_with_errors"
-d "exported=false"
-d "pay_to_account[type]=CoupaPay%3A%3AEmployeePaymentAccount"
-d "fields=%5B%22id%22,%22payment-batch-id%22,%22status%22,%22exchange_rate%22,%22updated_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,%22updated_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 CoupaPay Expense Payments - Fields query param",
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{URL}}/coupa_pay/payments?status[in]=completed_successfully,completed_with_errors&exported=false&pay_to_account[type]=CoupaPay::EmployeePaymentAccount&fields=[\"id\",\"payment-batch-id\",\"status\",\"exchange_rate\",\"updated_at\",{\"pay_from_account\":[\"id\",{\"currency\":[\"code\"]}]},{\"pay_to_currency\":[\"code\"]},{\"payee\":[\"number\"]},{\"digital_check\":[\"check_number\"]},{\"payment_details\":[\"id\",\"updated_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": "status[in]",
"value": "completed_successfully,completed_with_errors"
},
{
"key": "exported",
"value": "false"
},
{
"key": "pay_to_account[type]",
"value": "CoupaPay::EmployeePaymentAccount"
},
{
"key": "fields",
"value": "[\"id\",\"payment-batch-id\",\"status\",\"exchange_rate\",\"updated_at\",{\"pay_from_account\":[\"id\",{\"currency\":[\"code\"]}]},{\"pay_to_currency\":[\"code\"]},{\"payee\":[\"number\"]},{\"digital_check\":[\"check_number\"]},{\"payment_details\":[\"id\",\"updated_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": [
]
}