> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.shimi.cash/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.shimi.cash/_mcp/server.

# Generate Card

POST https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card
Content-Type: application/json

Issues a physical Verve card for a customer already registered via **Create Card Customer**.

**Body (JSON)** — both required (presence check only):

| Field        | Type   | Notes                                                                                        |
| ------------ | ------ | -------------------------------------------------------------------------------------------- |
| `customerId` | string | Customer already registered via **Create Card Customer**                                     |
| `number`     | string | Identifier of the physical card being assigned; forwarded to the provider as `cardReference` |

Always issues a **PHYSICAL**, **Verve**, **NGN** card with status `active` (these cannot be chosen). Returns **201**. Save `data.cardId` — it is the `cardId` used by every other card endpoint. Provider errors are returned verbatim as `Sudo API Error: <httpStatus> - <provider JSON>`.

> All errors from this folder use `{ "status": "error", "message": "..." }` and are returned as **HTTP 400** (including "Card not found" — there is no 404). Success bodies use `status: "success"` (not `success: true` like the VTU endpoints).

Reference: https://docs.shimi.cash/api-reference/shimi-api/card-issuing/generate-card

## Authentication

- `Authorization` header (bearer token, required) — Access token from Generate Access Token (valid 15 minutes).

## Request

### Body (application/json)

This endpoint expects an object.

- `customerId` (string, optional)
- `number` (string, optional)

## Response

### 201

Created

- `status` (string, optional)
- `message` (string, optional)
- `data` (CardGenerateCardPostResponsesContentApplicationJsonSchemaData, optional)

## Errors

### 400 Bad Request Error

Missing fields / Customer not registered for cards / Customer not found / Provider error

- `status` (string, optional)
- `message` (string, optional)

### 401 Unauthorized Error

Unauthorized

- `message` (string, optional)

### 403 Forbidden Error

Invalid or expired access token / KYB not approved / Account deactivated

- `message` (string, optional)
- `code` (string, optional)
- `kybStatus` (string, optional)

## Types

### CardGenerateCardPostResponsesContentApplicationJsonSchemaData

- `cardId` (string, optional)
- `customerId` (string, optional)
- `type` (string, optional)
- `brand` (string, optional)
- `currency` (string, optional)
- `status` (string, optional)
- `expiryYear` (string, optional)
- `expiryMonth` (string, optional)
- `maskedNumber` (string, optional)

## Examples

### 201 Created

**Response**

```json
{
  "status": "success",
  "message": "Card created successfully",
  "data": {
    "cardId": "cm2x8a1d20007l70f6yz4kq9m",
    "customerId": "cm2x7k9q80004l70fh3s1a2bc",
    "type": "PHYSICAL",
    "brand": "verve",
    "currency": "NGN",
    "status": "active",
    "expiryYear": "2029",
    "expiryMonth": "10",
    "maskedNumber": "506099*********4821"
  }
}
```

**SDK Code**

```python 201 Created
import requests

url = "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript 201 Created
const url = 'https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 201 Created
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 201 Created
require 'uri'
require 'net/http'

url = URI("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java 201 Created
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php 201 Created
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp 201 Created
using RestSharp;

var client = new RestClient("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift 201 Created
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Card Issuing_generateCard_example

**Request**

```json
{
  "customerId": "{{customer_id}}",
  "number": "1"
}
```

**Response**

```json
{
  "status": "success",
  "message": "Card created successfully",
  "data": {
    "cardId": "cm2x8a1d20007l70f6yz4kq9m",
    "customerId": "cm2x7k9q80004l70fh3s1a2bc",
    "type": "PHYSICAL",
    "brand": "verve",
    "currency": "NGN",
    "status": "active",
    "expiryYear": "2029",
    "expiryMonth": "10",
    "maskedNumber": "506099*********4821"
  }
}
```

**SDK Code**

```python Card Issuing_generateCard_example
import requests

url = "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card"

payload = {
    "customerId": "{{customer_id}}",
    "number": "1"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Card Issuing_generateCard_example
const url = 'https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"customerId":"{{customer_id}}","number":"1"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Card Issuing_generateCard_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card"

	payload := strings.NewReader("{\n  \"customerId\": \"{{customer_id}}\",\n  \"number\": \"1\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Card Issuing_generateCard_example
require 'uri'
require 'net/http'

url = URI("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customerId\": \"{{customer_id}}\",\n  \"number\": \"1\"\n}"

response = http.request(request)
puts response.read_body
```

```java Card Issuing_generateCard_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customerId\": \"{{customer_id}}\",\n  \"number\": \"1\"\n}")
  .asString();
```

```php Card Issuing_generateCard_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card', [
  'body' => '{
  "customerId": "{{customer_id}}",
  "number": "1"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Card Issuing_generateCard_example
using RestSharp;

var client = new RestClient("https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customerId\": \"{{customer_id}}\",\n  \"number\": \"1\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Card Issuing_generateCard_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "customerId": "{{customer_id}}",
  "number": "1"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://shimi-waas-api-9493532b9281.herokuapp.com/api/v1/card/generate-card")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```