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

# Creating Cards

Learn how to create physical and virtual cards via the Sudo Dashboard or API.

## 1. Create a cardholder

A cardholder is either an individual or business entity that can be issued a payment card. To get started, create a cardholder with a `name`, `billingAddress`, and `type`.

You can include additional information like `KYC details`, `phone number`, and `email address`.

<CodeGroup>
  ```curl curl theme={null}
  curl --location --request POST 'https://api.sandbox.sudo.cards/customers' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer ••••••••••••••••••••••••••••••••••••CREE1M0EwQjgyMjI0NUE3QUM=' \
  --data-raw '{
  	"type": "individual",
  	"name": "John Doe",
  	"status": "active",
  	"individual": {
  		"firstName": "John",
  		"lastName": "Doe"
  	},
  	"billingAddress": {
  		"line1": "4 Barnawa Close",
  		"line2": "Off Challawa Crescent",
  		"city": "Barnawa",
  		"state": "Kaduna",
  		"country": "NG",
  		"postalCode": "800001"
  	}
  }'
  ```
</CodeGroup>

A call to the cardholder's endpoint returns information about the cardholder that can be subsequently used to create a card.

## 2. Create a card for a cardholder

Create a card and assign it to a cardholder. This request requires the cardholder ID from the previous step, type, card number (if a physical card), currency, and status. More parameters might be required as per your requirements.

<CodeGroup>
  ```curl Create Card theme={null}
    curl --location --request POST 'https://api.sandbox.sudo.cards/cards' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer ••••••••••••••••••••••••••••••••••••CREE1M0EwQjgyMjI0NUE3QUM' \
    --data-raw '{
    	"customerId": "5f8b75ef12a06df84bd7aa3a",
    	"type": "physical",
    	"number": "5061000001743021565",
    	"currency": "NGN",
    	"status": "active"
    }'
  ```

  ```curl Virtual Card Using a Card Program theme={null}
    curl --location --request POST 'https://api.sandbox.sudo.cards/cards' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer ••••••••••••••••••••••••••••••••••••CREE1M0EwQjgyMjI0NUE3QUM' \
    --data-raw '{
    	"customerId": "670cf0ad25852ba485d7590d",
    	"programId": "6840b5161443c90831ba07a5",
    	"status": "active",
    	"metadata": {}
    }'
  ```

  ```curl Physical Card Using a Card Program theme={null}
    curl --location --request POST 'https://api.sandbox.sudo.cards/cards' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer ••••••••••••••••••••••••••••••••••••CREE1M0EwQjgyMjI0NUE3QUM' \
    --data-raw '{
    	"customerId": "670cf0ad25852ba485d7590d",
    	"programId": "6840b5161443c90831ba07a5",
    	"number": "5061000001743021565",
    	"status": "active",
    	"metadata": {}
    }'
  ```
</CodeGroup>

A call to the card's endpoint returns information about the card being mapped.

<Warning>
  In order to maintain PCI Compliance and high card data security, all requests to map or retrieve card details must be passed through the vault endpoint.
</Warning>
