# Payment vouchers

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


The Payment Voucher resource represents a voucher that has been created for a customer to initiate voucher-based payment. This resource contains relevant details such as the voucher URL, the amount of the voucher, the status of the voucher, and more. Currently, the only supported voucher-based payment source is Boleto. Boleto is a payment method in Brazil that is regulated by the Central Bank of Brazil and is considered an official form of payment. This is also a popular voucher-based payment method in Brazil.

**Note:** This resource can be extended in the future to support other types of payment sources for vouchers.

## Sample Payment-voucher

```json
{
  "payment_voucher": {
    "id": "pv_1mG11S1TcNM88A9Zm",
    "id_at_gateway": "pi_3N0VBuK7ilSfRo7v0D66epcC",
    "payment_voucher_type": "boleto",
    "expires_at": 1682365190,
    "status": "active",
    "amount": 17800,
    "gateway_account_id": "gw_161my9TXG5oNYwgv",
    "payment_source_id": "pm_1mG11S1TcNM3LP9ZX",
    "gateway": "stripe",
    "payload": "{\"url\":\"https://payments.stripe.com/boleto/voucher/test_YWNjdF8xTHZnMFRLN2lsU2ZSbzd2LF9ObTNJN2NoejBsYldJeDI0VTVxemkwbnJaZUVTN0FH0100PvfYwtjd\",\"voucher_number\":\"01010101010101010101010101010101010101010101010\",\"expiry\":\"1682365190\"}",
    "url": "http://john.chargebee.com/pages/v3/__dev__w5aPBsoEK5z6kIEt2mrEIH9GWLliHXrN/view_voucher",
    "date": 1682365010,
    "updated_at": 1682365010,
    "resource_version": 1682365010580,
    "object": "payment_voucher",
    "currency_code": "BRL",
    "customer_id": "test_d23ed22ew",
    "linked_invoices": [
      {
        "invoice_id": "61",
        "date": 1682364955,
        "total": 17800,
        "status": "payment_due"
      },
      {..}
    ]
  }
}
```

## Payment vouchers attributes

## Input Parameters

- `id` (required, string, max chars=40)
  Uniquely identifies the payment voucher.

- `id_at_gateway` (optional, string, max chars=100)
  The id with which this voucher is referred in gateway.

- `payment_voucher_type` (required, enumerated string)
  Type of the payment source.
  Possible enum values:
    - `boleto`
      Boleto

- `expires_at` (optional, timestamp(UTC) in seconds)
  Timestamp indicating when the Voucher will expire if left unconsumed.

- `status` (optional, enumerated string)
  Current status of the payment voucher.
  Possible enum values:
    - `active`
      Active and ready to be consumed
    - `consumed`
      Consumed for a transaction and cannot be used again
    - `expired`
      Expired before consumed and cannot be used again
    - `failure`
      Failed to create the voucher due to gateway rejection

- `subscription_id` (optional, string, max chars=50)
  Identifier of the subscription for which this payment voucher is made.

- `currency_code` (required, string, max chars=3)
  The currency code (ISO 4217 format) for the voucher.

- `amount` (optional, in cents, min=1)
  Amount for this payment voucher.

- `gateway_account_id` (optional, string, max chars=50)
  The gateway account used for this voucher

- `payment_source_id` (optional, string, max chars=40)
  Identifier of the payment source for which this payment voucher is created

- `gateway` (required, enumerated string)
  The gateway through which this payment voucher was created. **Note**: Note: Currently, `stripe` is the only supported gateway through which you can create the payment voucher.
  Possible enum values:
    - `chargebee`
      Chargebee test gateway.
    - `chargebee_payments`
      Chargebee Payments gateway
    - `adyen`
      Adyen is a payment gateway.
    - `stripe`
      Stripe is a payment gateway.
    - `wepay`
      WePay is a payment gateway.
    - `braintree`
      Braintree is a payment gateway.
    - `authorize_net`
      Authorize.net is a payment gateway
    - `paypal_pro`
      PayPal Pro Account is a payment gateway.
    - `pin`
      Pin is a payment gateway
    - `eway`
      eWAY Account is a payment gateway.
    - `eway_rapid`
      eWAY Rapid is a payment gateway.
    - `worldpay`
      WorldPay is a payment gateway
    - `balanced_payments`
      Balanced is a payment gateway
    - `beanstream`
      Bambora(formerly known as Beanstream) is a payment gateway.
    - `bluepay`
      BluePay is a payment gateway.
    - `elavon`
      Elavon Virtual Merchant is a payment solution.
    - `first_data_global`
      First Data Global Gateway Virtual Terminal Account
    - `hdfc`
      HDFC Account is a payment gateway.
    - `migs`
      MasterCard Internet Gateway Service payment gateway.
    - `nmi`
      NMI is a payment gateway.
    - `ogone`
      Ingenico ePayments (formerly known as Ogone) is a payment gateway.
    - `paymill`
      PAYMILL is a payment gateway.
    - `paypal_payflow_pro`
      PayPal Payflow Pro is a payment gateway.
    - `sage_pay`
      Sage Pay is a payment gateway.
    - `tco`
      2Checkout is a payment gateway.
    - `wirecard`
      WireCard Account is a payment service provider.
    - `amazon_payments`
      Amazon Payments is a payment service provider.
    - `paypal_express_checkout`
      PayPal Express Checkout is a payment gateway.
    - `gocardless`
      GoCardless is a payment service provider.
    - `orbital`
      Chase Paymentech(Orbital) is a payment gateway.
    - `moneris_us`
      Moneris USA is a payment gateway.
    - `moneris`
      Moneris is a payment gateway.
    - `bluesnap`
      BlueSnap is a payment gateway.
    - `cybersource`
      CyberSource is a payment gateway.
    - `vantiv`
      Vantiv is a payment gateway.
    - `checkout_com`
      Checkout.com is a payment gateway.
    - `paypal`
      PayPal Commerce is a payment gateway.
    - `ingenico_direct`
      Worldline Online Payments is a payment gateway.
    - `exact`
      Exact Payments is a payment gateway.
    - `mollie`
      Mollie is a payment gateway.
    - `quickbooks`
      Intuit QuickBooks Payments gateway
    - `razorpay`
      Razorpay is a fast growing payment service provider in India working with all leading banks and support for major local payment methods including Netbanking, UPI etc.
    - `global_payments`
      Global Payments is a payment service provider.
    - `bank_of_america`
      Bank of America Gateway
    - `ecentric`
      Ecentric provides a seamless payment processing service in South Africa specializing on omnichannel capabilities.
    - `metrics_global`
      Metrics global is a leading payment service provider providing unified payment services in the US.
    - `windcave`
      Windcave provides an end to end payment processing solution in ANZ and other leading global markets.
    - `pay_com`
      Pay.com provides payment services focused on simplicity and hassle-free operations for businesses of all sizes.
    - `ebanx`
      EBANX is a payment gateway, enabling businesses to accept diverse local payment methods from various countries for increased market reach and conversion.
    - `dlocal`
      Dlocal provides payment solutions for global commerce by accepting local payment methods.
    - `nuvei`
      Nuvei is a secure and reliable payment processing solution that allows you to accept payments from customers and suitable for various types of businesses.
      
      This feature is a **Private Beta Release**. [Request access](https://app.chargebee.com/login?forward=https://app.chargebee.com/request_access/nuvei&ref=feature) to enable Nuvei for your test and live sites.
    - `solidgate`
      Solidgate is a secure and reliable payment processing solution that allows you to accept payments from customers and suitable for various types of businesses.
      
      This feature is a **Private Beta Release**.
    - `paystack`
      Paystack is a payment gateway for businesses in Africa. It enables secure payment acceptance both online and offline.
      
      This feature is a **Private Beta Release**. [Request access](https://app.chargebee.com/login?forward=https://app.chargebee.com/request_access/paystack&ref=feature) to enable Paystack for your test and live sites.
    - `jp_morgan`
      J.P. Morgan Mobility Payment Solutions is a payment gateway that enables you to securely accept and manage digital payments across different [payment\_source\_type](/docs/api/payment_sources/payment_source-object#type).
      
      This feature is a **Private Beta Release**. [Request access](https://app.chargebee.com/login?forward=https://app.chargebee.com/request_access/jp-morgan-bacs&ref=feature) to enable the J.P. Morgan Mobility Payment Solutions gateway via payFURL for your test and live sites.
    - `deutsche_bank`
      Deutsche Bank is the leading German bank with strong European roots and a global network.
      
      This feature is a **Private Beta Release**.
    - `ezidebit`
      Ezidebit is a payment gateway integration based in Australia that supports automated direct debit, BPAY, and card payments for businesses.
      
      This feature is a **Private Beta Release**.
    - `twikey`
      Twikey is a payment service provider that specializes in processing direct debit payments across the EU.
    - `tempus`
      Tempus Technologies is a payment gateway and payments technology provider offering secure payment processing with point-to-point encryption (P2PE) and tokenization.
    - `moyasar`
      Moyasar is a fully integrated online payment service that makes accepting payments simple and secure.
    - `payway`
      Payway is a payment gateway that enables secure card and payment acceptance.
    - `payu`
      PayU is a payment gateway that enables secure card payment acceptance via PaymentsOS.
    - `not_applicable`
      Indicates that payment gateway is not applicable for this resource.

- `payload` (optional, string, max chars=65k)
  Payload from the gateway response with voucher details

- `error_code` (optional, string, max chars=100)
  Error code received from the payment gateway on failure.

- `error_text` (optional, string, max chars=65k)
  Error message received from the payment gateway on failure.

- `url` (optional, string, max chars=65k)
  Chargebee Hosted Page url for payment voucher

- `date` (optional, timestamp(UTC) in seconds)
  Indicates when this payment voucher occurred date.

- `resource_version` (optional, long)
  Version number of this resource. The `resource_version` is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.

- `updated_at` (optional, timestamp(UTC) in seconds)
  Timestamp indicating when this voucher was last updated.

- `customer_id` (required, string, max chars=50)
  The unique identifier of the customer.

- `linked_invoices` (optional, list of invoice_payment_voucher)
  Invoices related to the generated voucher
  - `invoice_id` (required, string, max chars=50)
    Identifier for the invoice.
  - `txn_id` (required, string, max chars=40)
    Uniquely identifies the payment voucher.
  - `applied_at` (required, timestamp(UTC) in seconds)
    Timestamp at which the transaction is applied.

