# MD for: https://www.mercadopago.com.pe/developers/es/docs/checkout-api-payments/integration-configuration/paycash.md
\# Paycash PayCash is a cash payment platform that allows buyers to pay bills and services at authorized physical establishments, such as banks, agents, and collection networks. With this option, the buyer generates a payment code and can pay it in person at any enabled location. With Mercado Pago's Checkout API, you can offer payments with \*\*Paycash\*\*, allowing your buyers to complete online purchases with cash payment. In this documentation, you will find all the steps needed to integrate with Paycash. ## Get available payment methods To get a detailed list of all payment methods available for integration, send a \*\*GET\*\* with your :toolTipComponent\[Access Token\]{content="Private key of the application created in Mercado Pago and used in the \_backend\_. You can access it through \*Your integrations > Integration data > Credentials\*."} to the endpoint :TagComponent{tag="API" text="/v1/payment\_methods" href="/developers/en/reference/payment\_methods/\_payment\_methods/get"} and execute the request or, if you prefer, make the request using the SDKs below.
* [csharp ](#editor%5F1)
* [curl ](#editor%5F2)
* [java ](#editor%5F3)
* [javascript ](#editor%5F4)
* [php ](#editor%5F5)
* [python ](#editor%5F6)
* [ruby ](#editor%5F7)
csharp curl java javascript php python ruby
```
MercadoPagoConfig.setAccessToken("ENV_ACCESS_TOKEN");
PaymentMethodClient client = new PaymentMethodClient();
client.list();
```
Copiar
```
curl -X GET \
-H 'accept: application/json' \
-H 'content-type: application/json' \
-H 'Authorization: Bearer ENV_ACCESS_TOKEN' \
'https://api.mercadopago.com/v1/payment_methods' \
```
Copiar
```
MercadoPagoConfig.setAccessToken("ENV_ACCESS_TOKEN");
PaymentMethodClient client = new PaymentMethodClient();
client.list();
```
Copiar
```
import { MercadoPagoConfig, PaymentMethods } from 'mercadopago';
const client = new MercadoPagoConfig({ accessToken: 'access_token' });
const paymentMethods = new PaymentMethods(client);
paymentMethods.get().then((result) => console.log(result))
.catch((error) => console.log(error));
```
Copiar
```
get();
?>
```
Copiar
```
import mercadopago
sdk = mercadopago.SDK("ACCESS_TOKEN")
payment_methods_response = sdk.payment_methods().list_all()
payment_methods = payment_methods_response["response"]
```
Copiar
```
require 'mercadopago'
sdk = Mercadopago::SDK.new('ENV_ACCESS_TOKEN')
payment_methods_response = sdk.payment_methods.get()
payment_methods = payment_methods_response[:response]
```
Copiar
\## Import MercadoPago.js To integrate Checkout API, you need to capture the necessary data to process the payment. This capture is done by including the MercadoPago.js library in your project, followed by the payment form. Use the code below to import the MercadoPago.js library before adding the payment form.
* [bash ](#editor%5F8)
* [html ](#editor%5F9)
bash html
```
npm install @mercadopago/sdk-js
```
Copiar
```
```
Copiar
\## Configure credentials Credentials are unique keys that we use to identify an integration in your account. They are used to capture payments in online stores and other applications securely. This is the first step in a complete code structure that must be followed to correctly integrate payments. Pay attention to the blocks below to add them as indicated. \`\`\`javascript const mp = new MercadoPago("YOUR\_PUBLIC\_KEY"); \`\`\` ## Add payment form With the MercadoPago.js library included, add the payment form below to your project to ensure the secure capture of buyer data. At this stage, it is important to use the list you consulted to get the available payment methods to create the payment options you want to offer. \`\`\`html
First name
Last name
E-mail
Document type
Document number
Pay
\`\`\` ## Get document types After configuring the credential and adding the payment form, you need to get the document types that will be used to fill out the payment form. By including the \`select\` element with the id: \`form-checkout\_\_identificationType\` that is in the form, it will be possible to automatically fill in the available options when calling the following function: \`\`\`javascript function createSelectOptions(elem, options, labelsAndKeys = { label : "name", value : "id"}){ const {label, value} = labelsAndKeys; elem.options.length = 0; const tempOptions = document.createDocumentFragment(); options.forEach( option => { const optValue = option\[value\]; const optLabel = option\[label\]; const opt = document.createElement('option'); opt.value = optValue; opt.textContent = optLabel; tempOptions.appendChild(opt); }); elem.appendChild(tempOptions); } // Get Identification Types (async function getIdentificationTypes () { try { const identificationTypes = await mp.getIdentificationTypes(); const docTypeElement = document.getElementById('form-checkout\_\_identificationType'); createSelectOptions(docTypeElement, identificationTypes) }catch(e) { return console.error('Error getting identificationTypes: ', e); } })() \`\`\` ## Send payment After completing the payment form inclusion and obtaining the document types, you need to send the buyer's email, document type and number, the payment method used, and the payment amount details using our Payments API or one of our SDKs. To configure payments with Paycash, send a \*\*POST\*\* with the required parameters to the endpoint :TagComponent{tag="API" text="/v1/payments" href="/developers/en/reference/payments/\_payments/post"} and execute the request or, if you prefer, use one of our SDKs indicated below. > WARNING > > For this step, when making the request via API or SDKs, you need to send your :toolTipComponent\[Access Token\]{content="Private key of the application created in Mercado Pago and used in the \_backend\_. You can access it through \*Your integrations > Integration data > Credentials\*."}. Additionally, you will be required to send the \`X-Idempotency-Key\` header with your idempotency key to ensure the execution and re-execution of requests, avoiding unwanted situations such as duplicate payments, for example.
* [csharp ](#editor%5F10)
* [curl ](#editor%5F11)
* [go ](#editor%5F12)
* [java ](#editor%5F13)
* [javascript ](#editor%5F14)
* [php ](#editor%5F15)
* [python ](#editor%5F16)
* [ruby ](#editor%5F17)
csharp curl go java javascript php python ruby
```
using MercadoPago.Config;
using MercadoPago.Client.Payment;
using MercadoPago.Resource.Payment;
MercadoPagoConfig.AccessToken = "ENV_ACCESS_TOKEN";
var request = new PaymentCreateRequest
{
DateOfExpiration = DateTime.Parse("2026-02-03T20:00:00.000-05:00"),
TransactionAmount = 5000,
Description = "Product title",
PaymentMethodId = "paycash",
Payer = new PaymentPayerRequest
{
Email = "test_user_mx@testuser.com",
},
};
var client = new PaymentClient();
Payment payment = await client.CreateAsync(request);
```
Copiar
```
curl --location 'https://api.mercadopago.com/v1/payments' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ENV_ACCESS_TOKEN' \
--header 'X-Idempotency-Key: ' \
--data-raw '{
"transaction_amount": 100,
"description": "Product title",
"date_of_expiration": "2026-02-03T20:00:00.000-05:00",
"payment_method_id": "paycash",
"payer": { "email": "test_user_mx@testuser.com" }
}'
```
Copiar
```
package main
import (
"context"
"fmt"
"time"
"github.com/mercadopago/sdk-go/pkg/config"
"github.com/mercadopago/sdk-go/pkg/payment"
)
func main() {
accessToken := "{{ACCESS_TOKEN}}"
idempotencyKey := "{{SOME_UNIQUE_VALUE}}"
cfg, err := config.New(accessToken)
if err != nil {
fmt.Println(err)
return
}
// Step 4: Initialize the API client
client := payment.NewClient(cfg)
// Step 5: Create the request array
expirationDate, _ := time.Parse(time.RFC3339, "2026-02-03T20:00:00.000-05:00")
request := payment.Request{
TransactionAmount: 5000,
Description: "Product title",
PaymentMethodID: "paycash",
Payer: &payment.PayerRequest{
Email: "",
},
DateOfExpiration: &expirationDate,
}
// Step 5: Make the request
resource, err := client.Create(context.Background(), request, idempotencyKey)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(resource)
}
```
Copiar
```
PaymentCreateRequest paymentCreateRequest = PaymentCreateRequest.builder()
.transactionAmount(new BigDecimal(""))
.paymentMethodId("")
.dateOfExpiration(OffsetDateTime.parse("2026-02-03T20:00:00.000-05:00"))
.payer(
PaymentPayerRequest.builder()
.email("").build()
).build();
Map customHeaders = new HashMap<>();
customHeaders.put("x-idempotency-key", "");
MPRequestOptions requestOptions = MPRequestOptions.builder()
.customHeaders(customHeaders).build();
PaymentClient client = new PaymentClient();
client.create(paymentCreateRequest, requestOptions);
```
Copiar
```
import { MercadoPagoConfig, Payments } from 'mercadopago';
const client = new MercadoPagoConfig({ accessToken: '' });
const payments = new Payments(client);
payments.create({
body: {
transaction_amount: '',
payment_method_id: '',
date_of_expiration: "2026-02-03T20:00:00.000-05:00",
payer: {
email: ''
}
},
requestOptions: { idempotencyKey: '' }
})
.then((result) => console.log(result))
.catch((error) => console.log(error));
```
Copiar
```
setCustomHeaders(["X-Idempotency-Key: "]);
$payment = $client->create([
"transaction_amount" => (float) $_POST[''],
"payment_method_id" => $_POST[''],
"date_of_expiration" => "2026-02-03T20:00:00.000-05:00",
"payer" => [
"email" => $_POST['']
]
], $request_options);
echo implode($payment);
?>
```
Copiar
```
import mercadopago
sdk = mercadopago.SDK("ENV_ACCESS_TOKEN")
payment_data = {
"transaction_amount": 100,
"description": "Product title",
"payment_method_id": "paycash",
"date_of_expiration": "2026-02-03T20:00:00.000-05:00",
"payer": {
"email": "test_user_mx@testuser.com"
}
}
payment_response = sdk.payment().create(payment_data)
payment = payment_response["response"]
```
Copiar
```
require 'mercadopago'
sdk = Mercadopago::SDK.new('ENV_ACCESS_TOKEN')
payment_request = {
transaction_amount: 100,
description: 'Product title',
payment_method_id: 'paycash',
date_of_expiration: '2026-02-03T20:00:00.000-05:00',
payer: {
email: 'test_user_mx@testuser.com'
}
}
payment_response = sdk.payment.create(payment_request)
payment = payment_response[:response]
```
Copiar
The details of each parameter sent in the request body, along with their possible values, are described in the table below. | Field | Type | Description | Required | Example | |---|---|---|---|---| | \`transaction\_amount\` | number | Transaction amount to be processed. | Required | 100 | | \`description\` | string | Brief description of the product or service. | Optional | "Product title" | | \`payment\_method\_id\` | string | Crucial field to initiate the payment flow; must be filled with the value \`"paycash"\`. | Required | "paycash" | | \`date\_of\_expiration\` | string | Expiration date of the payment ticket. If this field is not sent, a default expiration date of 2 days after ticket creation will be set. Only full days are considered for both the provided and default expiration date. Weekends are not counted. Therefore, if the integrator sends a date with minutes, the expiration date will be adjusted to the end of the day sent. Example: if the integrator sends \`"2026-02-03T20:00:00.000-05:00"\` (February 3, 2026 at 20:00, UTC-5), the expiration date will be February 3, 2026, set to 23:59 of that day. | Optional | "2026-02-03T20:00:00.000-05:00" | | \`payer\` | object | Contains detailed information about the payer, such as the email address. | Required | \`{ "email": "test\_user\_mx@testuser.com" }\` | The response will show the \`pending\` status until the buyer completes the payment. Additionally, in the response to the request, the \`external\_resource\_url\` parameter will return a URL containing the instructions for the buyer to make the payment. You can redirect them to this same link to complete the payment flow. \`\`\`json { "id": 146232108035, "date\_created": "2026-02-19T15:25:07.765-05:00", "date\_approved": null, "date\_last\_updated": "2026-02-19T15:25:07.765-05:00", "date\_of\_expiration": "2026-02-21T00:59:59.000-05:00", "money\_release\_date": null, "money\_release\_status": "released", "operation\_type": "regular\_payment", "issuer\_id": "12845", "payment\_method\_id": "paycash", "payment\_type\_id": "ticket", "payment\_method": { "id": "paycash", "type": "ticket", "issuer\_id": "12845", "data": {}, "forward\_data": {} }, "status": "pending", "status\_detail": "pending\_waiting\_payment", "currency\_id": "PEN", "description": null, "live\_mode": true, "sponsor\_id": null, "authorization\_code": null, "money\_release\_schema": null, "taxes\_amount": 0, "counter\_currency": null, "brand\_id": null, "shipping\_amount": 0, "build\_version": "3.143.0-rc-4", "pos\_id": null, "store\_id": null, "integrator\_id": null, "platform\_id": null, "corporation\_id": null, "charges\_execution\_info": { "internal\_execution": { "date": "2026-02-19T15:25:07.752-05:00", "execution\_id": "01KHVNSY80AK1CR7EFNTN1DFHM" } }, "payer": { "type": null, "id": "211339136", "operator\_id": null, "email": null, "identification": { "number": null, "type": null }, "phone": { "number": null, "extension": null, "area\_code": null }, "first\_name": null, "last\_name": null, "entity\_type": null }, "collector\_id": 164720860, "marketplace\_owner": null, "metadata": {}, "additional\_info": { "tracking\_id": "platform:v1-whitelabel,so:ALL,type:N/A,security:none" }, "order": {}, "external\_reference": null, "transaction\_amount": 100, "transaction\_amount\_refunded": 0, "coupon\_amount": 0, "differential\_pricing\_id": null, "financing\_group": null, "deduction\_schema": null, "barcode": { "content": "7041771529112930", "width": 1, "height": 30, "type": "Code128C" }, "installments": 1, "transaction\_details": { "payment\_method\_reference\_id": "7041771529112930", "acquirer\_reference": null, "barcode": { "content": "7041771529112930", "width": 1, "height": 30, "type": "Code128C" }, "digitable\_line": null, "verification\_code": "10550843579", "net\_received\_amount": 0, "total\_paid\_amount": 100, "overpaid\_amount": 0, "external\_resource\_url": "https://www.mercadopago.com.pe/payments/146232108035/ticket?caller\_id=211339136&hash=c67143dd-b538-4a74-ba8b-829ae0a3caeb", "installment\_amount": 0, "financial\_institution": null, "payable\_deferral\_period": null }, "fee\_details": \[\], "charges\_details": \[ { "id": "146232108035-001", "name": "mercadopago\_fee", "type": "fee", "accounts": { "from": "collector", "to": "mp" }, "client\_id": 0, "date\_created": "2026-02-19T15:25:07.767-05:00", "last\_updated": "2026-02-19T15:25:07.767-05:00", "amounts": { "original": 5.06, "refunded": 0 }, "metadata": { "source": "proc-svc-charges", "source\_detail": "processing\_fee\_charge", "reason": "" }, "reserve\_id": null, "refund\_charges": \[\], "external\_charge\_id": "01KHVNSY8XPAMY1NVZFG1MF4S4", "update\_charges": \[\] } \], "captured": true, "binary\_mode": false, "call\_for\_authorize\_id": null, "statement\_descriptor": null, "card": {}, "notification\_url": null, "refunds": \[\], "processing\_mode": "aggregator", "merchant\_account\_id": null, "merchant\_number": null, "point\_of\_interaction": { "type": "UNSPECIFIED", "business\_info": { "unit": "online\_payments", "sub\_unit": "default", "branch": "Merchant Services" }, "transaction\_data": {} }, "accounts\_info": null, "release\_info": null, "tags": null } \`\`\` ## Cancel payment Only payments with \*\*pending\*\* or \*\*in process\*\* status can be canceled. When the cancellation is performed by the seller, the \`status\_detail\` changes to \`by\_collector\`. Cancellation also occurs automatically when the current date exceeds the value set in the \`date\_of\_expiration\` field provided during payment creation. In that case, the \`status\_detail\` will be \`expired\`. For more information, see the \[Refunds and cancellations\](https://www.mercadopago.com.pe/developers/en/docs/checkout-api-legacy/payment-management/cancellations-and-refunds). ## Payment establishments When completing the integration, it is important to share with buyers the information about the different places where they can make the payment. To check the available establishments for PayCash payments, visit the \[official website\](https://paycashglobal.com/puntosperu/).