---
title: "Use Paycode"
source_url: https://docs.rapyd.net/en/use-paycode.html
lang: en
---

# Use Paycode

Collect a payment from a customer using a paycode that was created with the Payment API.

To use a paycode:

1. Create a payment that generates a paycode. See [Create Payment](https://docs.rapyd.net/en/create-payment.md "Create Payment").
2. Get the paycode details See [Get Paycode Details](https://docs.rapyd.net/en/get-paycode-details.md "Get Paycode Details").
3. Use the paycode.

> **Note:**
>
> The base URL for the POS production environment is **https://pos.rapyd.net**. It requires its own access key, which is different from the access key for the Payment API. To obtain an access key for the POS production environment and to set up a sandbox environment for the POS API, contact **[Rapyd Client Support](https://support.rapyd.net)**.

### Parameters

### Request Path Parameters

- - payment
  - ID of the payment. String starting with **payment_**.

### Request Header Parameters

- - access_key
  - Unique access key provided by Rapyd for each authorized user.

    See [Developers](https://docs.rapyd.net/en/developers.md "Developers").
- - Content-Type
  - Indicates that the data appears in JSON format. Set to **application/json**.
- - operation_id
  - Operation ID received from [Open Session](https://docs.rapyd.net/en/open-session.md "Open Session").
- - timestamp
  - Timestamp for the request, in Unix time.
- - token_id
  - Token ID received from [Open Session](https://docs.rapyd.net/en/open-session.md "Open Session").

### Request Body Parameters

- - metadata
  - A JSON object defined by the client. See [Metadata](https://docs.rapyd.net/en/metadata.md "Metadata").

### Response Parameters

- - amount
  - Amount of the payment. Decimal.
- - cart
  - Describes the items purchased with the paycode. Array of objects containing the following fields:

    - - description
      - Description of the item.
    - - external_id
      - External ID of the item.
    - - name
      - Name of the item.
    - - price
      - Price of the item
    - - quantity
      - Number of items.
- - code
  - Paycode.
- - created_at
  - Time of creation of the payment, in Unix time.
- - currency_code
  - Currency of the transaction.
- - currency_symbol
  - Unicode symbol for the currency specified in the 'currency_code' field.
- - description
  - Description of the payment.
- - expired_at
  - End of the time allowed for the customer to complete the payment, in Unix time.
- - id
  - ID of the payment. String starting with **payment_**.
- - metadata
  - A JSON object defined by the client. See [Metadata](https://docs.rapyd.net/en/metadata.md "Metadata").
- - operation_id
  - Operation ID.
- - org_id
  - ID of the merchant's organization.
- - phone_number
  - Phone number of the Rapyd wallet.
- - pos_id
  - ID of the point of sale. UUID.
- - status
  - Status of the transaction.
- - used_at
  - Time that the paycode was used for the payment, in Unix time.
- - user_profile_id
  - Reserved.

- /v1/pos/paycode/{payment}

- Use Paycode
- ```curl
  curl -X post
  https://sandboxpos.rapyd.net/v1/pos/paycode/payment_b4c0f8ce17074fbedb0af9d8d3810806
  -H 'access_key: your-access-key-here'
  -H 'Content-Type: application/json'
  -H 'idempotency: your-idempotency-parameter-here'
  -H 'salt: your-random-string-here'
  -H 'signature: your-calculated-signature-here'
  -H 'timestamp: your-unix-timestamp-here'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "16395a3a-e072-433a-8b51-7b2ccbc0792c"
      },
      "data": {
          "id": "payment_b4c0f8ce17074fbedb0af9d8d3810806",
          "org_id": "",
          "type": 1,
          "code": "9600196969569008",
          "status": "CLO",
          "amount": 300.6,
          "currency_code": "EUR",
          "expired_at": 1664877238,
          "user_profile_id": "",
          "phone_number": "+14155558990",
          "pos_id": "ac3dbdfe-0e14-11e7-8115-0ef1982c1e4a",
          "used_at": 1663667891,
          "created_at": 1663658880,
          "cart": [
              {
                  "name": "Jet black shoes",
                  "price": "100.20000",
                  "description": "Shoes",
                  "quantity": 3,
                  "external_id": "A-1139"
              }

  		    ],
          "description": "",
          "currency_symbol": "€",
          "metadata": null
      }
  }
  ```
