Mall
The product has been specially designed for those integrating companies of different brands with different lines of business which can be grouped while maintaining their diversity in the same virtual space or mall.
Offering the possibility of grouping the payment of purchases made in multiple virtual stores in a single transaction.
https://app.payku.cl/ (Default server) · https://des.payku.cl/ (Sandbox server)Create Mall transaction
Section titled “Create Mall transaction”/api/mallThis method allows the insertion of data from a transaction.
Request body
| Parameter | Type | Description |
|---|---|---|
emailrequired |
string <email> | Customer email. |
paymentrequired |
integer | Identifier of the payment method. If the identifier is sent, the payer will be redirected directly to the indicated means of payment.
|
merchantrequired |
array of arrays | Array containing the clients, each client is an array containing its public token or marketplace affiliation id, transaction value, description, id of the specific event which if not owned must pass null and individual order number. |
orderrequired |
integer | Trade order, this must be unique. |
urlreturnrequired |
string <url> | return url of the trade where payku will redirect the payer. |
urlnotify |
string <url> | callback url of the business where payku will notify the payment. |
curl -X POST \https://BASE_URL/api/mall \-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]", "payment": 1, "merchant": [ ["81b6179e4feeef2b50af71d660f830de", "30000", "item1", null, "4545"], ["bcf6c06c523d9394be41bc0174c43d1476f274abb342955aac93cc8014737b3b","25000","item2", null, "4546"], ["PUBLIC-TOKEN","15000","item3", null, "4547"] ], "order": 123, "urlreturn": "https://youwebsite.cl/urlreturn", "urlnotify": "https://youwebsite.cl/urlnotify" }'$client = new \GuzzleHttp\Client(); $body = $client->request('POST', 'https://BASE_URL/api/mall', [ 'json' => [ 'payment' => 1, 'merchant' => [ ['81b6179e4feeef2b50af71d660f830de', '30000', 'item1', null, '4545'], ['bcf6c06c523d9394be41bc0174c43d1476f274abb342955aac93cc8014737b3b','25000','item2', null, '4546'], ['PUBLIC-TOKEN','15000','item3', null, '4547'] ], 'order' => 123, 'urlreturn' => 'https://youwebsite.cl/urlreturn', 'urlnotify' => 'https://youwebsite.cl/urlnotify' ], 'headers' => [ 'Sign' => 'f96ddc14a73a4dd6e009db2514108a3f44832795cd5ac50e6a80fd0b0ae92112', 'Authorization' => 'Bearer PUBLIC-TOKEN' ] ])->getBody();$response = json_decode($body);const request = async (data) => { const response = await fetch('https://BASE_URL/api/mall', { 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 = { payment: 1, merchant: [ ["81b6179e4feeef2b50af71d660f830de", "30000", "item1", null, "4545"], ["bcf6c06c523d9394be41bc0174c43d1476f274abb342955aac93cc8014737b3b","25000","item2", null, "4546"], ["PUBLIC-TOKEN","15000","item3", null, "4547"] ], order: 123, urlreturn: "https://youwebsite.cl/urlreturn", urlnotify: "https://youwebsite.cl/urlnotify"};request(data);Responses
{ "status": "success", "individual_orders": [ { "merchant": "81b6179e4feeef2b50af71d660f830de", "amount": 30000, "subject": "item1", "event": null, "identificador": "9917068816213146", "individual_order": "9654" }, { "merchant": "81b6179e4feeef2b50af71d66f7830de", "amount": 25000, "subject": "item2", "event": null, "identificador": "9917068816213146", "individual_order": "9654" }, { "merchant": "81b6179e4fffff2b50af71d66f7830de", "amount": 15000, "subject": "item3", "event": null, "identificador": "9917068816213146", "individual_order": "9654" } ], "url": "https://BASE_URL/gateway/mall/malld200058ab44739ddee2adcd2f5"}Response fields
| Parameter | Type | Description |
|---|---|---|
status |
string | Transaction status The possible statuses you can get are the following:
|
individual_orders |
array of objects | Arrangement containing beneficiary information. |
merchant |
string | Beneficiary's name. |
amount |
string | Amount of the product or service. |
detail |
string | Description of the transaction. |
event |
string | ID of the event, if it does not have event it must pass null. |
identificador |
string | Transaction identifier. |
individual_order |
string | Individual transaction identifier. |
url |
string | URL has redirect user. |
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. |
Wrong 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 Mall transaction
Section titled “Get Mall transaction”/api/mall/{identificadorTrasaccion}This method allows you to obtain the information of a payment made in Payku
Path parameters
| Parameter | Type | Description |
|---|---|---|
idrequired |
string | id of the transaction to request |
curl -X GET \https://BASE-URL/api/mall/ID-IDENTIFICADOR \-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/mall/malld200058ab44739ddee2adcd2f5', [ 'headers' => [ 'Sign' => 'f96ddc14a73a4dd6e009db2514108a3f44832795cd5ac50e6a80fd0b0ae92112', 'Authorization' => 'Bearer PUBLIC-TOKEN' ] ])->getBody();$response = json_decode($body);const request = async () => { const response = await fetch('https://BASE_URL/api/mall/malld200058ab44739ddee2adcd2f5', { method: 'GET', headers: { 'Content-Type': 'application/json', 'Sign' => 'f96ddc14a73a4dd6e009db2514108a3f44832795cd5ac50e6a80fd0b0ae92112', 'Authorization' => 'Bearer PUBLIC-TOKEN' }, }); const result = await response.json(); console.log(result)}request();Responses
{ "status": "success", "id": "10ac494c1d8da71d98ea", "created_at": "2019-10-25 14:10:03", "amount": "98745", "payment": { "media": "Webpay", "verification_key": "6669cbd982ef54c28f2f15fb9dc5262d", "authorization_code": "107742", "last_4_digits": "1233", "card_type": "", "currency": "CLP" }, "merchant": [ { "name": "John Doe", "amount": 30000, "subject": "item1" }, { "name": "Jane Doe", "amount": 25000, "subject": "item2" }, { "name": "Enteprise", "amount": 15000, "subject": "item3" } ]}Response fields
| Parameter | Type | Description |
|---|---|---|
status |
string | Transaction status The possible statuses you can get are the following:
|
id |
string | Identifier of the transaction created by Payku. |
created_at |
string | Registration date. |
amount |
string | Amount. |
payment |
object | |
media |
string | Payment method, used by the user. |
verification_key |
string | Verification code created by Payku. |
authorization_code |
string | Authorization code. |
last_4_digits |
string | Last 4 digits of the affiliated card. |
card_type |
string | Card type. |
currency |
string | Currency. |
merchant |
array of objects | Arrangement containing beneficiary information. |
name |
string | Name of the beneficiary. |
amount |
string | Amount of the product or service. |
subject |
string | Description of the product or service. |
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. |
Wrong 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 |