Escrow Transaction
This functionality will allow escrow accounts authorized by Payku to settle transactions.
Base URL:
https://app.payku.cl/ (Default server) · https://des.payku.cl/ (Sandbox server)Authorize settlement
Section titled “Authorize settlement”POST
/api/escrowThis method allows authorizing the settlement of one or more transactions using their identifier, so that they can be deposited in the client's wallet or bank account.
Request body
| Parameter | Type | Description |
|---|---|---|
transactions |
array of anys | Arrangement containing the identifier of each of the transactions to be authorized for settlement. |
curl -X POST \https://BASE-URL/api/escrow \-H 'Accept: application/json, text/plain, */*' \-H 'Authorization: Bearer PUBLIC-TOKEN' \-H 'Content-Type: application/json' \-H 'Host: BASE-URL' \-d '{ "transactions": ["trx3b4d77b43acd9a720","trx3b4d77b43acd9a385"]}'$client = new \GuzzleHttp\Client(); $body = $client->request('POST', 'https://BASE_URL/api/escrow', [ 'json' => [ 'transactions' => ['trx3b4d77b43acd9a720','trx3b4d77b43acd9a385'], ], 'headers' => [ 'Authorization' => 'Bearer PUBLIC-TOKEN' ] ])->getBody();$response = json_decode($body);const request = async (data) => { const response = await fetch('https://BASE_URL/api/escrow', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer PUBLIC-TOKEN' }, body: JSON.stringify(data) }); const result = await response.json(); console.log(result)}
let data = { transactions: ['trx3b4d77b43acd9a720','trx3b4d77b43acd9a385'],};
request(data);Responses
200
{ "transactions": [ { "status": "liquidate", "transaction_id": "trx3b4d77b43acd9a720", "amount": 15000, "availability_date": "2021-07-01", "deposit_date": "2021-07-06" }, { "status": "pending", "transaction_id": "trx3b4d77b43bdd9a540", "amount": 20000, "availability_date": "2021-07-25", "deposit_date": "N/D" } ]}Response fields
| Parameter | Type | Description |
|---|---|---|
transactions |
array of objects | |
status |
string | Transaction status:
|
transaction_id |
string | Transaction identifier created by Payku. |
amount |
integer | Total amount of traction. |
availability_date |
string | Date of availability to authorize the settlement. |
deposit_date |
string | Payment date of the settlement. |
400
Request failed.
{ "status": "failed", "type": "Unprocessable Entity", "message_error": "subject:invalid,amount:is empty,email:is empty,order:invalid"}Response fields
| Parameter | Type | Description |
|---|---|---|
status |
string | Request status. |
type |
string | Type of error. |
message_error |
string | Error message. |
401
Incorrect public token.
{ "type": "Unauthorized", "message_error": { "error": "waiting token public" }}Response fields
| Parameter | Type | Description |
|---|---|---|
type |
string | Request status. |
message_error |
object | |
error |
string | Error message. |