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

# Create Physical Cards

> Order physical cards for your Users.

## Create Physical Card Process

<Steps titleSize="h3">
  <Step title="Create a Card Order">
    [This endpoint creates a new `CardOrder` with the status of `PENDINGTRANSACTION`](/api-reference/physical-card-order/create-physical-card-order):

    ```bash cURL theme={null}
    curl -X POST /api/v1/order/create
    ```

    The Card Order is created with the following data:

    * A shipping address can be specified by filling the `shippingAddress` field, see [endpoint specifications](/api-reference/physical-card-order/create-physical-card-order). If not set, the KYC address will be used for shipping.
    * The total amount to be paid is set in EURe. The amount is 30.23.
    * A coupon code can be applied to reduce the amount to be paid, either at signup or in the next step
  </Step>

  <Step title="(Optional) Attach a Coupon">
    [This endpoint attaches a coupon to the `CardOrder` with `orderId`](/api-reference/physical-card-order/attach-a-coupon-to-a-physical-card-order):

    ```bash cURL theme={null}
    curl -X POST /api/v1/order/{orderId}/attach-coupon
    ```

    The coupon needs to be valid, otherwise an error is thrown.
    If the user has a coupon code both from the signup, and from this step, the one from the signup takes precedence.
  </Step>

  <Step title="(Optional) Attach an on-chain transaction">
    <Note>
      This is only needed if the card is not free. If `CardOrder.totalAmountEUR` is the same as the `CardOrder.totalDiscountEUR` then the card is considered free.
    </Note>

    [This endpoint allows setting a transaction hash to the specified `orderId`](/api-reference/physical-card-order/register-payment-for-a-physical-card-order).

    ```bash cURL theme={null}
    curl -X PUT /api/v1/order/{orderId}/attach-transaction \
    -d '{
      "transactionHash": "0x..."
    }'
    ```

    The transaction can only be used once across all card orders.
  </Step>

  <Step title="Confirm the payment was performed">
    <Warning>
      This endpoint must be called even if the card is free. It moves the card order to the `READY` status.
    </Warning>

    [To confirm the payment call this endpoint](/api-reference/physical-card-order/confirm-the-payment-for-a-physical-card-order):

    ```bash cURL theme={null}
    curl -X PUT /api/v1/order/{orderId}/confirm-payment
    ```

    The conditions for the payment are:

    * In order to call this endpoint, the `CardOrder.status` needs to be `PENDINGTRANSACTION`.
    * If the card is not free, we check if a payment was done.
      * Token used for payment needs to be EURe `0xcB444e90D8198415266c6a2724b7900fb12FC56E`.
      * Payment was done to `0x3D4FD6a1A7a1382ae1d62C3DD7247254a0236847`.
      * The respective EURe amount was paid in that transaction hash (partial transfers are not supported).

    If all the conditions above are met, the `CardOrder.status` is set to `READY`.
  </Step>

  <Step title="Create the Physical Card">
    [Finally, you can create the Physical Card](/api-reference/physical-card-order/create-a-physical-card):

    ```bash cURL theme={null}
    curl -X POST /api/v1/order/:orderId/create-card
    ```

    When successful, this endpoint returns the `cardToken` from the newly created card.

    In order to create a `Card` out of a `CardOrder` the following conditions need to be met:

    * No cards were created out of this `orderId`.
    * User needs to have a verified phone number.
    * User needs to have a name set.
    * User needs to be from a supported country.
    * User address needs to be set.
    * User needs to have an approved KYC.
    * The risk score needs to be Green or Orange based on the user's answers to the Source of funds questionnaire.
    * User needs to have the shipping details for the physical card order set.
      * The shipping details can be different from the KYC address, as long as it is in the same country.
      * Virtual cards do not require a shipping address.
    * The embossed name for the card needs to be set.
  </Step>

  <Step title="Set the Card PIN using the Partner Secure Elements (PSE)">
    The card PIN should be set immediately after the card is created via the Partner Secure Elements (PSE).
    Use the `cardToken` returned from the previous endpoint to set the PIN.
    If a PIN is not provided upon creation, a random one will be assigned.
    Changing this randomly assigned PIN requires the user to visit an ATM. Refer to the **[card PINs section](/cards#card-pins)** to learn more about the online and offline PINs.

    For detailed instructions about how to change the PIN, please refer to the [PSE SDK documentation](/cards/pse-integration).
  </Step>
</Steps>
