Skip to content

Subscription

It allows the linking of a plan to Clients, to later make recurring charges automatically, as defined in each plan.

Base URL: https://app.payku.cl/ (Default server) · https://des.payku.cl/ (Sandbox server)
POST/api/suclient

This method allows the insertion of Client data.

Request body

ParameterTypeDescription
emailrequired string <email>

Client email.

maximum 50 characters
namerequired string

Client name

maximum 80 characters
Example: Joe Doe
rut string

Single Tax Registry of the client, the entry of this data with or without a hyphen will be allowed.

12 characters required
Example: 11111111
phonerequired string

Client phone.

20 characters required
Example: 923122312
address string

Client address.

maximum 200 characters
Example: Moneda 101
country string

Client country.

maximum 40 characters
Example: Chile
region string

Client region.

maximum 120 characters
Example: Metropolitana
city string

Client city.

maximum 40 characters
Example: Santiago
postal_code string

Client Zip Code.

maximum 10 characters
Example: 850000
additional_parameters object

Client additional parameters

maximum 4000 characters
parameter_1 string

Client additional parameter

Example: example
parameter_2 string

Client additional parameter

Example: example
curl -X POST \
https://BASE_URL/api/suclient \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SIGN' \
-H 'Authorization: Bearer TOKEN_PUBLICO' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \
-d {
"email": "[email protected]",
"name": "Joe Doe",
"rut": "111111111",
"phone": "923122312",
"address": "Moneda 101",
"country": "Chile",
"region": "Metropolitana",
"city": "Santiago",
"postal_code": "850000,
"additional_parameters":{
"parameter_1": "example",
"parameter_2": "example 2",
}
}'

Responses

200
{
"status": "active",
"id": "cl0be4c8e623c167bc8b29",
"rut": "11111111",
"name": "Joe Doe",
"phone": "923122312",
"email": "[email protected]",
"address": "Moneda 101",
"country": "Chile",
"region": "Metropolitana",
"city": "Santiago",
"postal_code": "850000",
"create_at": "2020-09-29",
"update_at": null,
"subcriptions": null,
"additional_parameters": {
"parameter_1": "example",
"parameter_2": "example"
}
}
Response fields
ParameterTypeDescription
status string

Client status.

Example: active
id string

Identifier of the transaction created by payku.

Example: cl0be4c8e623c167bc8b29
rut string

Single Tax Registry of the client.

Example: 11111111
name string

Client name.

Example: Joe Doe
phone string

Client phone.

Example: 923122312
email string

Client email.

address string

Client address.

Example: Moneda 101
country string

Client country.

Example: Chile
region string

Client region.

Example: Metropolitana
city string

Client city.

Example: Santiago
postal_code string

Client Zip Code.

Example: 850000
create_at string <datetime>

Registration date.

Example: 2020-09-29
update_at string <datetime>

Update date.

subcriptions object

Client subscriptions.

additional_parameters object

Client additional parameters

parameter_1 string

Client additional parameter

Example: example
parameter_2 string

Client additional parameter

Example: example
GET/api/suclient/{idClient} or {emailClient}

This method allows obtaining the details of a client or the client's email.

Path parameters

ParameterTypeDescription
idrequired string

Unique transaction identifier per payku.

maximum 20 characters
curl -X GET \
https://BASE_URL/api/suclient/id \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SIGN' \
-H 'Authorization: Bearer TOKEN_PUBLICO' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \

Responses

200
{
"status": "active",
"id": "cl0be4c8e623c167bc8b29",
"rut": "11111111",
"name": "Joe Doe",
"phone": "923122312",
"email": "[email protected]",
"address": "Moneda 101",
"city": "Santiago",
"region": "Metropolitana",
"country": "Chile",
"postal_code": "850000",
"create_at": "2020-09-29",
"update_at": null,
"active_cards": [
{
"last_4_digits": "XXXXXXXXXXXX6622",
"identifier": "surec804a8ed60c747cb8839",
"card_type": "Visa",
"register": "2022-07-26 08:00:19"
},
{
"last_4_digits": "XXXXXXXXXXXX1234",
"identifier": "surec804a8ed60c747cb8843",
"card_type": "MasterCard",
"register": "2023-01-01 12:00:00"
}
],
"additional_parameters": {
"parameter_1": "example",
"parameter_2": "example"
},
"subcriptions": {
"id": "su867f07772aa5f5175527",
"created_at": "2020-09-29 19:58:35",
"status": "active",
"amount": "15000",
"plan": [
{
"id": "pl9697fb170834ad42dd00",
"name": "test plan",
"currency": "CLP"
}
],
"cards": [
{
"last_4_digits": "6622",
"card_type": "Visa"
}
],
"transactions": [
{
"created_at": "2020-09-30 19:58:35",
"date_payment": "2020-09-30",
"amount": "10000",
"transaction": "204444",
"authorization_code": "1234",
"order": "001",
"description": "description",
"status": "success"
}
]
}
}
Response fields
ParameterTypeDescription
status string

Client status.

Example: active
id string

Identifier of the transaction created by payku.

Example: cl0be4c8e623c167bc8b29
rut string

Single Tax Registry of the client.

Example: 11111111
name string

Client name.

Example: Joe Doe
phone string

Client phone.

Example: 923122312
email string

Client email.

address string

Client address.

Example: Moneda 101
city string

Client city.

Example: Santiago
region string

Client region.

Example: Metropolitana
country string

Client country.

Example: Chile
postal_code string

Client Zip Code.

Example: 850000
create_at string <datetime>

Registration date.

Example: 2020-09-29
update_at string <datetime>

Update date.

active_cards array of objects
Example: [{"last_4_digits":"XXXXXXXXXXXX6622","identifier":"surec804a8ed60c747cb8839","card_type":"Visa","register":"2022-07-26 08:00:19"},{"last_4_digits":"XXXXXXXXXXXX1234","identifier":"surec804a8ed60c747cb8843","card_type":"MasterCard","register":"2023-01-01 12:00:00"}]
last_4_digits string

Last 4 digits of the affiliated carda.

Example: XXXXXXXXXXXX6622
identifier string

id card.

Example: surec804a8ed60c747cb8839
card_type string

card type.

Example: Visa
register string

Register date.

Example: 2022-07-26 08:00:19
additional_parameters object

Client additional parameters

parameter_1 string

Client additional parameter

Example: example
parameter_2 string

Client additional parameter

Example: example
subcriptions object
id string

Subscription identifier created by payku.

Example: su867f07772aa5f5175527
created_at string <datetime>

Registration date.

Example: 2020-09-29 19:58:35
status string

Subscription status. The possible statuses you can get are the following:

  • register
  • active
  • finish
  • delete
  • cancel
  • suspended
Example: active
amount string

Subscription amount.

Example: 15000
plan array of objects
id string

Identifier of the plan created by payku.

Example: pl9697fb170834ad42dd00
name string

Plan name.

Example: test plan
currency string

Currency.

Example: CLP
cards array of objects
last_4_digits string

Last 4 digits of the affiliated card.

Example: 6622
card_type string

Card type.

Example: Visa
transactions array of objects
created_at string

Transaction creation date.

Example: 2020-09-30 19:58:35
date_payment string

Date the transaction was made.

Example: 2020-09-30
amount string

Transaction amount.

Example: 10000
transaction string

Transaction number.

Example: 204444
authorization_code string

Authorization code.

Example: 1234
order string

Number of order.

Example: 001
description string

Description.

Example: description
status string

Transaction status The possible statuses you can get are the following:

  • pending
  • success
  • retry
  • canceled by customer
  • canceled by paymaster
  • canceled by payku
  • maximum attempt limit
  • first payment rejected
  • payment consumes failed
Example: success
PUT/api/suclient/{idClient} or {emailClient}

This method allows updating a Client's data.

Path parameters

ParameterTypeDescription
idrequired string

Unique transaction identifier per payku.

maximum 20 characters

Request body

ParameterTypeDescription
email string <email>

Client email.

maximum 50 characters
name string

Client name

maximum 80 characters
Example: Joe Doe Doe
phone string

Client phone.

maximum 20 characters
Example: 923122312
address string

Client address.

maximum 200 characters
Example: Moneda 121
country string

Client country.

maximum 40 characters
Example: Chile
region string

Client region.

maximum 120 characters
Example: Metropolitana
city string

Client city.

maximum 40 characters
Example: Santiago
postal_code string

Client Zip Code.

maximum 10 characters
Example: 750000
additional_parameters object

Client additional parameters

maximum 4000 characters
parameter_1 string

Client additional parameter

Example: example
parameter_2 string

Client additional parameter

Example: example
curl -X PUT \
https://BASE_URL/api/suclient/id \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SIGN' \
-H 'Authorization: Bearer TOKEN_PUBLICO' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \
-d {
"email": "[email protected]",
"name": "Joe Doe Doe",
"phone": "923122312",
"address": "Moneda 121",
"country": "Chile",
"region": "Metropolitana",
"city": "Santiago",
"postal_code": "750000",
"additional_parameters":{
"parameter_1": "example",
"parameter_2": "example 2",
}
}'

Responses

200
{
"status": "active",
"id": "cl0be4c8e623c167bc8b29",
"name": "Joe Doe Doe",
"phone": "923122312",
"email": "[email protected]",
"address": "Moneda 121",
"city": "Santiago",
"region": "Metropolitana",
"country": "Chile",
"postal_code": "750000",
"create_at": "2020-09-29",
"update_at": "2020-10-2 08:32:52",
"additional_parameters": {
"parameter_1": "example",
"parameter_2": "example"
},
"subcriptions": {
"id": "su867f07772aa5f5175527",
"created_at": "2020-09-29 19:58:35",
"status": "active",
"amount": "15000",
"plan": [
{
"id": "pl9697fb170834ad42dd00",
"name": "test plan",
"currency": "CLP"
}
],
"cards": [
{
"last_4_digits": "6622",
"card_type": "Visa"
}
],
"transactions": [
{
"created_at": "2020-09-30 19:58:35",
"date_payment": "2020-09-30",
"amount": "10000",
"transaction": "204444",
"authorization_code": "1234",
"order": "001",
"description": "description",
"status": "success"
}
]
}
}
Response fields
ParameterTypeDescription
status string

Client status.

Example: active
id string

Transaction identifier created by payku.

Example: cl0be4c8e623c167bc8b29
name string

Client name.

Example: Joe Doe Doe
phone string

Client phone.

Example: 923122312
email string

Client email.

address string

Client address.

Example: Moneda 121
city string

Client city.

Example: Santiago
region string

Client region.

Example: Metropolitana
country string

Client country.

Example: Chile
postal_code string

Client Zip Code.

Example: 750000
create_at string <datetime>

Registration date.

Example: 2020-09-29
update_at string <datetime>

Update date.

Example: 2020-10-2 08:32:52
additional_parameters object

Client additional parameters

parameter_1 string

Client additional parameter

Example: example
parameter_2 string

Client additional parameter

Example: example
subcriptions object
id string

Subscription identifier created by payku.

Example: su867f07772aa5f5175527
created_at string <datetime>

Registration date.

Example: 2020-09-29 19:58:35
status string

Subscription status. The possible statuses you can get are the following:

  • register
  • active
  • finish
  • delete
  • cancel
  • suspended
Example: active
amount string

Subscription amount.

Example: 15000
plan array of objects
id string

Identifier of the plan created by payku.

Example: pl9697fb170834ad42dd00
name string

Plan name.

Example: test plan
currency string

currency.

Example: CLP
cards array of objects
last_4_digits string

Last 4 digits of the affiliated card.

Example: 6622
card_type string

Card type.

Example: Visa
transactions array of objects
created_at string

Transaction creation date.

Example: 2020-09-30 19:58:35
date_payment string

Date the transaction was made.

Example: 2020-09-30
amount string

Transaction amount.

Example: 10000
transaction string

Transaction number.

Example: 204444
authorization_code string

Authorization code.

Example: 1234
order string

Number of order.

Example: 001
description string

Description.

Example: description
status string

Transaction status The possible statuses you can get are the following:

  • pending
  • success
  • retry
  • canceled by customer
  • canceled by paymaster
  • canceled by payku
  • maximum attempt limit
  • first payment rejected
  • payment consumes failed
Example: success
DELETE/api/suclient/{idClient} or {emailClient}

This method allows the elimination of a client associated with a user id.

Path parameters

ParameterTypeDescription
idrequired string

Unique transaction identifier per payku.

maximum 20 characters
curl -X DELETE \
https://BASE_URL/api/suclient/id \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SIGN' \
-H 'Authorization: Bearer TOKEN_PUBLICO' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \

Responses

200
{
"status": "success",
"id": "cl0be4c8e623c167bc8b29"
}
Response fields
ParameterTypeDescription
status string

Client status.

Example: success
id string

Transaction identifier created by payku.

Example: cl0be4c8e623c167bc8b29
GET/api/suclient/customers

This method allows to obtain all Clients.

curl -X GET \
https://BASE_URL/api/suclient/customers \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SIGN' \
-H 'Authorization: Bearer TOKEN_PUBLICO' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \

Responses

200
[
{
"Customers": [
{
"status": "active",
"id": "cl0be4c8e623c167bc8b29",
"rut": "11111111",
"name": "Joe Doe",
"phone": "923122312",
"email": "[email protected]",
"address": "Moneda 101",
"city": "Santiago",
"region": "Metropolitana",
"country": "Chile",
"postal_code": "850000",
"create_at": "2020-09-29",
"update_at": null,
"active_cards": [
{
"last_4_digits": "XXXXXXXXXXXX6622",
"identifier": "surec804a8ed60c747cb8839",
"card_type": "Visa",
"register": "2022-07-26 08:00:19"
},
{
"last_4_digits": "XXXXXXXXXXXX1234",
"identifier": "surec804a8ed60c747cb8843",
"card_type": "MasterCard",
"register": "2023-01-01 12:00:00"
}
],
"subcriptions": {
"id": "su867f07772aa5f5175527",
"created_at": "2020-09-29 19:58:35",
"status": "active",
"amount": "15000",
"plan": [
{
"id": null,
"name": null,
"currency": null
}
],
"cards": [
{
"last_4_digits": null,
"card_type": null
}
],
"transactions": [
{
"created_at": null,
"date_payment": null,
"amount": null,
"transaction": null,
"authorization_code": null,
"order": null,
"description": null,
"status": null
}
]
}
}
]
}
]
POST/api/sususcription

This method allows the user of a Payku account to create a subscription to a fixed-amount subscription plan, a consumer plan subscription and a variable-amount subscription to one of its clients, for this last type of subscription it is necessary to send the amount that will be charged in the subscription, it is important to note that when making this request for the first time there will be a charge of $ 50 that allows verifying that the card is active and valid, in the case of a fixed subscription plan the service charge will be automatic From the month following the subscription date and in the event that the subscription is to a consumer plan, it will be necessary to use the api / sutransaction endpoint to generate the transaction.

Request body

ParameterTypeDescription
planrequired string

Plan id.

maximum 70 characters
Example: pl9697fb170834ad42dd00
clientrequired string

Client id.

maximum 20 characters
Example: cl9b1e1dd988694f30fa30
amountoneOf · option 1required string

This field will only be used in the case of variable amount subscription plans, it is important to note that the currency to be used in this type of plan is CLP.

maximum 14 digits
coupononeOf · option 2required string

Coupon code

maximum 50 characters
curl -X POST \
https://BASE_URL/api/sususcription \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SIGN' \
-H 'Authorization: Bearer TOKEN_PUBLICO' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \
-d {
"plan": "pl9697fb170834ad42dd00",
"client": "cl9b1e1dd988694f30fa30"
}'

Responses

200
{
"status": "register",
"id": "sucaab7865dceaff49d8b3",
"url": "http://app.payku.cl/gateway/registrosuscripcion?tipoplan=2&plan=true&token=219&validacion=e6c50ba0e0"
}
Response fields
ParameterTypeDescription
status string

Status.

Example: register
id string

Unique subscription identifier for payku.

Example: sucaab7865dceaff49d8b3
url string

Url payment and subscription activation.

Example: http://app.payku.cl/gateway/registrosuscripcion?tipoplan=2&plan=true&token=219&validacion=e6c50ba0e0
GET/api/sususcription

This method allows obtaining all the subscriptions associated with a user ID, this method allows a pagination with a maximum of 100 records per page, in addition, it has a date filter, if this parameter is not entered, the current date will be taken, for the pagination, it is necessary to add the following at the end of the endpoint? page = 1 & per_page = 100, the first parameter being the number of the page and the second the number of records per page. status: you can filter the search for subscriptions depending on the status you want to search for by adding the status to search equal to true. If none is added, by default all subscriptions will be searched without discrimination by status.

curl -X GET \
https://BASE_URL/api/sususcription \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SIGN' \
-H 'Authorization: Bearer TOKEN_PUBLICO' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \

Responses

200
[
{
"subscriptions": [
{
"id": "sucaab7865dceaff49d8b7",
"status": "active",
"last_status_current_payment": "pending",
"start": "2019-07-22 18:34:49",
"end": "2020-06-12 00:00:00",
"client": {
"id": "su7e5e1c0b1bd2e37ec557",
"name": "name",
"email": "[email protected]",
"rut": "1.111.111-1",
"phone": "56928265454",
"parametros": [],
"additional_parameters": ""
},
"plan": {
"id": "pl9697fb170834ad42dd00",
"name": "test plan",
"currency": "CLP"
},
"cards": {
"last_4_digits": "6622",
"card_type": "Visa"
},
"transactions": [
{
"created_at": "2020-09-30 19:58:35",
"amount": "10000",
"transaction": "204444",
"authorization_code": "1234",
"order": "001",
"description": "description",
"status": "success"
}
],
"logs": {
"status": [
{
"change_date": null,
"initial_status": null,
"final_status": null
}
]
}
}
]
}
]
GET/api/sususcriptionv3

This method allows obtaining all the subscriptions associated with a user ID, this method allows a pagination with a maximum of 4000 records per page, in addition, it has the following filters:

date_init: indicates the date from which you want to start the subscription search, if this parameter is not sent the search will start with the current date. date_end: indicates the date where you want the subscription search to end, if this parameter is not sent, the search will have the current date as the end date. estatus: you can filter the search for subscriptions depending on the status you want to search for by adding the status to search equal to true, if none is added, by default all subscriptions will be searched without discrimination by status.

For pagination it is necessary to add the following at the end of the endpoint ?page=1&per_page=100 the first parameter being the page number and the second the number of records per page. In case you want to search for the subscriptions between the dates 01-09-2021 and 15-09-2021, also that they are only active status subscriptions, the url to use would be the following: https://[URL_BASE]/api/sususcriptionv3?date_init=2021-09-01&date_end=2021-09-15&active=true.

curl -X GET \
https://BASE_URL/api/sususcriptionv3 \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SHA256-REQUEST-PATH-VALUE-PRIVATE-TOKEN' \
-H 'Authorization: Bearer PUBLIC-TOKEN' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \

Responses

200
[
{
"subscriptions": [
{
"id": "sucaab7865dceaff49d8b7",
"estatus": "active",
"start": "2019-07-22 18:34:49",
"end": "2023-06-12 00:00:00",
"client": {
"id": "su7e5e1c0b1bd2e37ec557",
"name": "name",
"email": "[email protected]",
"rut": "11.111.111-1",
"phone": "56928265454",
"parametros": [],
"additional_parameters": ""
},
"plan": {
"id": "pl9697fb170834ad42dd00",
"name": "test plan",
"currency": "CLP"
},
"active_cards": {
"last_4_digits": "XXXXXXXXXXXX6622",
"card_type": "Visa"
},
"logs": {
"status": [
{
"change_date": null,
"initial_status": null,
"final_status": null
}
]
},
"paid": [
{
"payment_cycle_day": "2021-07-09",
"payment_day": "2021-07-09",
"status": "success",
"amount_paid": 2500,
"try_number": 1,
"paid_number": 1,
"transactions": []
}
]
}
]
}
]
POST/api/sutransaction

This method allows the user of a Payku account to generate a unique transaction to one of his clients who are subscribed to a consumption plan.

Request body

ParameterTypeDescription
suscriptionrequired string

Unique subscription identifier for payku.

maximum 60 characters
Example: sucaab7865dceaff49d8b3
amount string

Amount.

maximum 14 digits
Example: 10000
order string

Order.

maximum 40 characters
Example: 001
description string

Description.

maximum 1000 characters
Example: Description
curl -X POST \
https://BASE_URL/api/sutransaction \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SIGN' \
-H 'Authorization: Bearer TOKEN_PUBLICO' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \
-d {
"suscription": "sucaab7865dceaff49d8b3",
"amount": "10000",
"order": "001",
"description": "Description"
}'

Responses

200
{
"status": "success",
"order": "001",
"amount": "10000",
"transaction_id": "204444",
"verification_key": "025dcad37e071daa8bfc2df35189009db65692a4ff766856108be1675e870839"
}
Response fields
ParameterTypeDescription
status string

Transaction status. The possible statuses you can get are the following:

  • pending
  • success
  • rejected
  • refunded partial
  • refunded
Example: success
order string

Order.

Example: 001
amount string

Amount.

Example: 10000
transaction_id string

Transaction number.

Example: 204444
verification_key string
Example: 025dcad37e071daa8bfc2df35189009db65692a4ff766856108be1675e870839
GET/api/sususcription/{idSuscription}

This method allows you to get the details of a subscription.

Path parameters

ParameterTypeDescription
idrequired string

Unique transaction identifier per payku.

maximum 20 characters
curl -X GET \
https://BASE_URL/api/sususcription/id \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SIGN' \
-H 'Authorization: Bearer TOKEN_PUBLICO' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \

Responses

200
{
"id": "sucaab7865dceaff49d8b7",
"status": "active",
"start": "2019-07-22 18:34:49",
"end": "2020-06-12 00:00:00",
"client": {
"id": "su7e5e1c0b1bd2e37ec557",
"name": "name",
"email": "[email protected]",
"rut": "1.111.111-1",
"phone": "[email protected]",
"parametros": [],
"additional_parameters": ""
},
"plan": {
"id": "pl9697fb170834ad42dd00",
"name": "test plan",
"currency": "CLP"
},
"cards": {
"last_4_digits": "6622",
"card_type": "Visa"
},
"active_cards": [
{
"last_4_digits": "XXXXXXXXXXXX6622",
"identifier": "surec804a8ed60c747cb8839",
"card_type": "Visa",
"register": "2022-07-26 08:00:19"
},
{
"last_4_digits": "XXXXXXXXXXXX1234",
"identifier": "surec804a8ed60c747cb8843",
"card_type": "MasterCard",
"register": "2023-01-01 12:00:00"
}
],
"transactions": [
{
"created_at": "2020-09-30 19:58:35",
"amount": "10000",
"transaction": "204444",
"authorization_code": "1234",
"order": "001",
"description": "description",
"status": "success"
}
],
"logs": {
"status": [
{
"change_date": "2021-02-17 16:11:53",
"initial_status": "register",
"final_status": "active"
}
]
}
}
Response fields
ParameterTypeDescription
id string

Subscription identifier created by payku.

Example: sucaab7865dceaff49d8b7
status string

Subscription status. The possible statuses you can get are the following:

  • register
  • active
  • finish
  • delete
  • cancel
  • suspended
Example: active
start string

Subscription start date.

Example: 2019-07-22 18:34:49
end string

Subscription termination date.

Example: 2020-06-12 00:00:00
client object
id string

Client identifier created by payku.

Example: su7e5e1c0b1bd2e37ec557
name string

Client name.

Example: name
email string

Client email.

rut string

Unique Roll Tributary.

Example: 1.111.111-1
phone string

Client phone.

parametros array of anys
additional_parameters array of anys

Additional parameters that Payku can send.

Example:
plan object
id string

Identifier of the plan created by payku.

Example: pl9697fb170834ad42dd00
name string

Plan name.

Example: test plan
currency string

Currency.

Example: CLP
cards object
last_4_digits string

Last 4 digits of the affiliated card.

Example: 6622
card_type string

Card type.

Example: Visa
active_cards array of objects
Example: [{"last_4_digits":"XXXXXXXXXXXX6622","identifier":"surec804a8ed60c747cb8839","card_type":"Visa","register":"2022-07-26 08:00:19"},{"last_4_digits":"XXXXXXXXXXXX1234","identifier":"surec804a8ed60c747cb8843","card_type":"MasterCard","register":"2023-01-01 12:00:00"}]
last_4_digits string

Last 4 digits of the affiliated carda.

Example: XXXXXXXXXXXX6622
identifier string

id card.

Example: surec804a8ed60c747cb8839
card_type string

card type.

Example: Visa
register string

Register date.

Example: 2022-07-26 08:00:19
transactions array of objects
created_at string

Transaction creation date.

Example: 2020-09-30 19:58:35
amount string

Transaction amount.

Example: 10000
transaction string

Transaction number.

Example: 204444
authorization_code string

Authorization code.

Example: 1234
order string

Number of order.

Example: 001
description string

Description.

Example: description
status string

Transaction status The possible statuses you can get are the following:

  • pending
  • success
  • rejected
  • refunded partial
  • refunded
Example: success
logs object

Object with information records about subscriptions

status array of objects

Array containing the status changes that were made on the subscription

change_date string

Date the change was made

Example: 2021-02-17 16:11:53
initial_status string

Initial subscription status

Example: register
final_status string

Final subscription status

Example: active
DELETE/api/sususcription/{idSuscription}

This method allows the removal of a subscription associated with a subscription id.

Path parameters

ParameterTypeDescription
idrequired string

Unique transaction identifier per payku.

maximum 20 characters
curl -X DELETE \
https://BASE_URL/api/sususcription/id \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SIGN' \
-H 'Authorization: Bearer TOKEN_PUBLICO' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \

Responses

200
{
"id": "sucaab7865dceaff49d8b3",
"status": "success"
}
Response fields
ParameterTypeDescription
id string

Transaction identifier created by payku.

Example: sucaab7865dceaff49d8b3
status string

Status.

Example: success
POST/api/suinscriptionscards

This method allows the insertion of the data of a subscription card.

Important

In case you need to renew your client's card. this method will allow you to add a new card to the subscription.

Immediately upon updating the card associated with the subscription, the system will be able to make the corresponding late charges according to the configuration of the subscribed plan!, That is, if the subscription is in a suspended status due to maximum collection attempts made, and the customer registers a new card, the system will be able to review pending payments, make the corresponding charge, and automatically activate the subscription.

Request body

ParameterTypeDescription
suscriptionrequired string

Subscription ID.

maximum 60 characters
Example: sucaab7865dceaff49d8b3
curl -X POST \
https://BASE_URL/api/suinscriptionscards \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SIGN' \
-H 'Authorization: Bearer PUBLIC_TOKEN' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \
-d {
"suscription": "sucaab7865dceaff49d8b3"
}'

Responses

200
{
"status": "success",
"id": "sucaab7865dceaff49d8b3",
"url": "https://BASE_URL/gateway/registrosuscripcion?plan=true&token=246&validacion=d6b32"
}
Response fields
ParameterTypeDescription
status string

Status.

Example: success
id string

Unique subscription identifier for payku.

Example: sucaab7865dceaff49d8b3
url string

URL paid and subscription activation.

Example: https://BASE_URL/gateway/registrosuscripcion?plan=true&token=246&validacion=d6b32
POST/api/suscriptionsdeletecards

This method allows you to delete a card associated with the subscription.

Request body

ParameterTypeDescription
suscriptionrequired string

ID of the associated card.

maximum 60 characters
Example: surec804a8ed60c0a8cb8839
curl -X POST \
https://BASE_URL/api/suscriptionsdeletecards \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SHA256-REQUEST-PATH-VALUE-PRIVATE-TOKEN' \
-H 'Authorization: Bearer PUBLIC_TOKEN' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \
-d {
"card": "surec804a8ed60c0a8cb8839"
}'

Responses

200
{
"status": "Delete",
"card": "surec804a8ed60c0a8cb8839"
}
Response fields
ParameterTypeDescription
status string

Status.

Example: Delete
card string

Identificador único de La tarjeta asociada a la suscripción.

Example: surec804a8ed60c0a8cb8839
GET/api/suplan/{idPlan}

This method allows to obtain the details of a plan.

Path parameters

ParameterTypeDescription
idrequired string

Unique plan identifier per payku.

maximum 20 characters
curl -X GET \
https://BASE_URL/api/suplan/id \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SIGN' \
-H 'Authorization: Bearer TOKEN_PUBLICO' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \

Responses

200
{
"status": "success",
"plans": {
"id": "pl4293e97a87195bb9edcd",
"status": "active",
"name": "Test plan",
"code": "001",
"description": "Test Plan",
"url_notify_payment": "",
"url_notify_suscription": "",
"total_suscription": 0,
"total_suscription_active": 0
}
}
Response fields
ParameterTypeDescription
status string

Status.

Example: success
plans object
id string

Unique plan identifier per payku.

Example: pl4293e97a87195bb9edcd
status string

Plan status.

Example: active
name string

Plan name.

Example: Test plan
code string

Plan code.

Example: 001
description string

Plan description.

Example: Test Plan
url_notify_payment string <url>
Example:
url_notify_suscription string <url>
Example:
total_suscription integer

Total subscriptions.

Example: 0
total_suscription_active integer

Total active subscriptions.

Example: 0
GET/api/suplan/plans

This method allows to obtain the details of all the plans.

curl -X GET \
https://BASE_URL/api/suplan/plans \
-H 'Accept: application/json, text/plain, */*' \
-H 'Sign: SIGN' \
-H 'Authorization: Bearer TOKEN_PUBLICO' \
-H 'Content-Type: application/json' \
-H 'Host: BASE_URL' \

Responses

200
{
"status": "success",
"plans": [
{
"id": "pl4293e97a87195bb9edcd",
"status": "active",
"name": "Test plan",
"code": "001",
"description": "Test Plan",
"url_notify_payment": "",
"url_notify_suscription": "",
"total_suscription": 0,
"total_suscription_active": 0
}
]
}
Response fields
ParameterTypeDescription
status string

Status.

Example: success
plans array of objects
id string

Unique plan identifier per payku.

Example: pl4293e97a87195bb9edcd
status string

Plan status.

Example: active
name string

Plan name.

Example: Test plan
code string

Plan code.

Example: 001
description string

Plan description.

Example: Test Plan
url_notify_payment string <url>
Example:
url_notify_suscription string <url>
Example:
total_suscription integer

Total subscriptions.

Example: 0
total_suscription_active integer

Total active subscriptions.

Example: 0
POST/urlnotifysuscription

After activating the subscription by the user, payku will notify the merchant, the result of the operation (status), making a post request to the subscription notification url previously provided in the creation of the subscription and in turn deliver a series of data for internal validations by the merchant application, the subscription id which corresponds to the unique identifier in payku. This data will allow the merchant to know the status of their subscriptions and back them up in their database.

Responses

200
{
"id": "su74866857980c7d2b4306",
"status": "active"
}
Response fields
ParameterTypeDescription
id string

Subscription identifier created by Payku.

Example: su74866857980c7d2b4306
status string

Subscription status. The possible statuses you can get are the following:

  • register
  • active
  • finish
  • delete
  • cancel
  • suspended
Example: active
POST/urlnotifypayment

After charging the subscription automatically, payku will notify the merchant, the result of the operation (status), making a post request to the payment notification url previously provided in the creation of the subscription and in turn deliver a data series for internal validations by the merchant application, the transactionn_id which corresponds to the unique identifier in payku and a verification_key, which corresponds to a unique validation hash per transaction. These data will allow the merchant to know the status of their transactions and back them up in their database.

Responses

200
{
"transaction_id": 9123123,
"verification_key": "2ba83615f863e72sdca5dfd0a6df2782",
"order": 1568041684,
"status": "success"
}
Response fields
ParameterTypeDescription
transaction_id number

Unique transaction identifier by Payku.

Example: 9123123
verification_key string

Unique transaction hash.

Example: 2ba83615f863e72sdca5dfd0a6df2782
order string

Unique transaction identifier sent by the merchant.

Example: 1568041684
status string

Transaction status The possible statuses you can get are the following:

  • pending
  • success
  • rejected
  • refunded partial
  • refunded
Example: success