> ## Documentation Index
> Fetch the complete documentation index at: https://developers.epayclub.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PayCash

> Collect cash payments from customers using the PayCash voucher network in Mexico.

Accept cash payments from Mexican customers using PayCash. Customers receive a payment voucher and complete the transaction by paying in cash at a participating store (e.g. OXXO, 7-Eleven).

<Info>
  This payment method only supports one-time (non-recurring) payments. It is available for MXN transactions to customers in Mexico.
</Info>

<Info>
  The legacy `PWC` payment option value is still accepted as an alias for `PAYCASH` and routes to the same flow.
</Info>

## Payment flow

Several steps occur between creating the order and completing the PayCash charge.

1. [Create an order](#creating-the-order) with the customer's information.
2. [Encrypt](/api-basics/encryption) and send the pay order request.
3. [Redirect](#completing-the-payment) the customer to get their cash voucher.
4. Confirm the payment and inform the customer of its outcome.

### Creating the Order

Follow the standard [create order](/orders/create-orders) flow, setting `customer.mobile` to the customer's Mexican phone number and `customer.country` to `MX`.

```json theme={null}
{
   "customer":{
      "firstname":"Ana",
      "lastname":"García",
      "mobile":"+521234567890",
      "country":"MX",
      "email":"ana@example.com"
   },
   "order":{
      "amount":250,
      "reference":"40cac2b6-6793-489a-8c96-c97a18b3c58a",
      "description":"Deposit via PayCash",
      "currency":"MXN"
   }
}
```

### Initiating the Payment

Encrypt the order reference and `paymentoption` before sending it to the pay order [endpoint](/api-reference/orders/pay).

<CodeGroup>
  ```json Example (Unencrypted) theme={null}
  {
      "reference": "40cac2b6-6793-489a-8c96-c97a18b3c58a",
      "paymentoption": "PAYCASH"
  }
  ```

  ```json Example (Encrypted) theme={null}
  {
    "data": "B9pQJ1HoxybgfjNnEro+26w7lQZ6jriF3AFiUeGH2Ggacn6cF0srUlqiHEXeEncJcMw6ThDobjuS+AsmvhNfvGPGMddjbt5rcK2JrUnUI4cHk0XebJKoNnjEqivcyq0UKEMdYOLd6mYZtvKu5FMlpz0Lo0aMY49pnYvUGLSsCf/wOhlPx9PHgQDXptT+WBJcO3lzeD8O0S4IVSWPCWPLi7GhGlqhZpheEi1FHq39TCHk12hL3sqkkIktZIkkQVAe8AkwZGhy/CMJZrTzU6IXZr2ulT7mJenZljSk66m0pARcUqwMw/+5PEPECDo8SX3IkX2hmym02pGuWZeHE9ONWcaW7h8UIroQ/+kThz/RtP/UMiK3596cij66JcW+RcXKPiqNKysskcnaOlQFIFuhEiAczimLgd320RrQzehaw1C33UGsCzAG1p2EnDthjTF63BZtEhVlu9kN7qtFCz9AvojZeaZFKOxpJJ0usfwl9Hq5oAa56AFt/3IIsvqrAktTOyMgQ/jGQ6uhRYpA6UAH0CcYyv7L99hgVtRTXAxA/rpCtY7aTR9Pjxb5Lt1IV0Q1V8fWxAv0yY+ss07qeiSIsccsdJiN4LaMx3RvmDlu54XF68w51L34hOCDj/NBoPVUZrSaCJK2GPJ6CjOHI8q2/U2TkU+y+a80XCAC/rgqGhw="
  }
  ```
</CodeGroup>

Upon receiving your request, we will return a successful response with a redirect URL for our hosted PayCash payment page.

```json 200 OK [expandable] theme={null}
{
    "data": {
        "paymentDetail": {
            "redirectUrl": "https://checkout-widget.epayclub.com/apm/PGW-PAYREF-CFE5A0D0D31B4E54AABAAD89F123F422",
            "recipientAccount": null,
            "paymentReference": "CP1B3F264C-8DB1-47C1-A50E-6494FB927D51"
        },
        "bankTransferDetails": null,
        "orderPayment": {
            "orderId": 628,
            "orderPaymentReference": "PGW-PAYREF-CFE5A0D0D31B4E54AABAAD89F123F422",
            "currency": "MXN",
            "statusId": 2,
            "orderPaymentResponseCode": "02",
            "orderPaymentResponseMessage": "pending-authentication",
            "orderPaymentInstrument": null,
            "remarks": "Order payment initiated",
            "totalAmount": 250.00,
            "fee": 0.00
        }
    },
    "status": "success",
    "statusCode": "02",
    "message": "pending-authentication"
}
```

### Completing the Payment

Redirect the customer to `paymentDetail.redirectUrl`. This takes them to our hosted PayCash payment page, where we present the voucher code (and a link to view/print it) that the customer takes to a participating store to pay in cash. This is an offline, asynchronous payment method — it can take up to the voucher's expiry window to be confirmed, and we'll notify you once it is.

### Verifying the Payment

<Info>
  [Read](/orders/verify-orders) the transaction verification section to learn how to verify your PayCash transactions.
</Info>

## Testing your integration

<Warning>
  Kindly [contact](mailto:support@epayclub.com) the support team to enable PayCash testing on your account.
</Warning>

Follow these guidelines to successfully test your PayCash integration:

1. Use a MXN order currency — PayCash is only available for MXN transactions.
2. Set `customer.country` to `MX` when creating the order.
3. Expect the transaction to remain in a pending state until the simulated/test cash payment is confirmed.
