Nullification
Allows you to request the cancellation of a transaction made through payku.
https://app.payku.cl/ (Default server) · https://des.payku.cl/ (Sandbox server)Create nullification
Section titled “Create nullification”/api/nullificationThis method allows you to create a reversal of a transaction.
Request body
| Parameter | Type | Description |
|---|---|---|
id |
string | Identifier of the transaction which you want to cancel. |
amount |
int | Transaction amount. |
subject |
string | description of the cancellation request. |
curl -X POST \https://BASE-URL/api/nullification \-H 'Accept: application/json, text/plain, */*' \-H 'Authorization: Bearer PUBLIC-TOKEN' \-H 'Sign: f96ddc14a73a4dd6e009db2514108a3f44832795cd5ac50e6a80fd0b0ae92112' \-H 'Content-Type: application/json' \-H 'Host: BASE-URL' \-d '{ 'id': 'trxpr2a45s1dytg1', 'amount': 25000, 'subject': 'nullable request'}'$client = new \GuzzleHttp\Client(); $body = $client->request('POST', 'https://BASE_URL/api/nullification', [ 'json' => [ 'id' => 'trxpr2a45s1dytg1', 'amount' => 25000, 'subject' => "transaction annulment" ], 'headers' => [ 'Sign' => 'f96ddc14a73a4dd6e009db2514108a3f44832795cd5ac50e6a80fd0b0ae92112', 'Authorization' => 'Bearer PUBLIC-TOKEN' ] ])->getBody();$response = json_decode($body);const request = async (data) => { const response = await fetch('https://BASE_URL/api/nullification', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Sign': 'f96ddc14a73a4dd6e009db2514108a3f44832795cd5ac50e6a80fd0b0ae92112', 'Authorization': 'Bearer PUBLIC-TOKEN' }, body: JSON.stringify(data) }); const result = await response.json(); console.log(result)}
let data = { 'id': 'trxpr2a45s1dytg1', 'amount': 25000, 'subject': 'transaction annulment'};
request(data);Responses
{ "status": "success", "nullify": { "id": "trxpr2a45s1dytg1", "amount": 25000, "currency": "CLP", "type": "total", "status_nullify": "complete", "payment": { "gateway": "webpay", "payment_type": "VC" }, "created_at": "2017-05-17T19:12:57.189Z", "updated_at": "2017-05-17T19:12:57.189Z" }, "gateway_response": { "status": "No availability in the wallet", "message": "The cancellation will be executed after the amount requested is deducted from your next settlement", "nptify": "No availability in the wallet" }}Response fields
| Parameter | Type | Description |
|---|---|---|
status |
string | Registration status |
nullify |
object | |
id |
string | Identifier of the transaction which you want to cancel. |
amount |
number | Transaction amount |
currency |
string | Currency |
type |
string | NotificationTypes of registration:
|
status_nullify |
string | Annulement status:
|
payment |
object | |
gateway |
string | Payment method |
payment_type |
string | Payment type |
created_at |
string | Cancellation request creation date |
updated_at |
string | Cancellation request update date |
gateway_response |
object | Response to the cancellation request |
status |
string | Status of registration of the request for annulment |
message |
string | Application process message |
nptify |
string | Notification on the status of the cancellation request |
Error in the request.
{ "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. |
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. |
get nullification
Section titled “get nullification”/api/nullification/{identifier}This method allows you to obtain nullification requests made to payku by means of an identifier:
To perform the query it is necessary to add the following at the end of the endpoint /{identifier} for example: api/nullification/trxpr2a45s1dytg1.
curl -X GET \https://BASE-URL/api/nullification/{identifier} \-H 'Accept: application/json, text/plain, */*' \-H 'Authorization: Bearer PUBLIC-TOKEN' \-H 'Content-Type: application/json' \-H 'Host: BASE-URL' \$client = new \GuzzleHttp\Client(); $body = $client->request('GET', 'https://BASE_URL/api/nullification/{identifier}', [ 'headers' => [ 'Authorization' => 'Bearer PUBLIC-TOKEN' ] ])->getBody();$response = json_decode($body);const request = async () => { const response = await fetch('https://BASE_URL/api/nullification/{identifier}', { method: 'GET', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer PUBLIC-TOKEN' }, }); const result = await response.json(); console.log(result)}
request();Responses
{ "nullify": { "id": "trxpr2a45s1dytg1", "amount": 25000, "currency": "CLP", "type": "total", "status_nullify": "complete", "payment": { "gateway": "webpay", "payment_type": "VC" }, "created_at": "2017-05-17T19:12:57.189Z", "updated_at": "2017-05-17T19:12:57.189Z" }}Response fields
| Parameter | Type | Description |
|---|---|---|
nullify |
object | Return data from the creation of a cancellation request |
id |
string | Identifier of the transfer for which cancellation is to be requested. |
amount |
number | Transaction amount |
currency |
string | Currency |
type |
string | NotificationTypes of registration:
|
status_nullify |
string | Annulement status:
|
payment |
object | |
gateway |
string | Payment method |
payment_type |
string | Payment type |
created_at |
string | Cancellation request creation date |
updated_at |
string | Cancellation request update date |
Error in the request.
{ "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. |
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. |
identifier does not exist.
{ "status": "failed", "type": "Not Found", "id": "is not valid"}Response fields
| Parameter | Type | Description |
|---|---|---|
status |
string | Request status. |
type |
string | Type of error. |
id |
string | Id information |
Generate callback.
Section titled “Generate callback.”callbackFrom the payku application, you can generate the notification url from the configuration section.
Example of callback response:
{
"id": "morexxzxxx",
"id_transaction": "morexxzxxx",
"ordencompra": "367734544",
"fecha": "24-08-2023 12:29:35",
"monto": 7000,
"status": "complete"
}