> Index of every page: https://docs.merchantservicedepot.com/llms.txt

# Bulk create customers


`POST /v1/bulk_jobs/customers`

Creates each customer through the same validation, tenant boundary, and provider mirror as the single-customer route. The idempotency key identifies the whole frozen job.

Auth: a secret key with the `bulkJobs.createCustomers` permission. Returns `200` with Bulk job.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `items` | body | array | No | The lines being billed. Each carries a description, a quantity, and a unitAmount in minor units; the invoice totals itself from them, so amount becomes optional. |

## Request

**curl**

```curl
curl -X POST "https://payments-api-sandbox.merchantservicedepot.com/v1/bulk_jobs/customers" \
  -H "Authorization: Bearer $MYELA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "items": [
    {
      "email": "grace-{{$guid}}@example.com",
      "name": "Grace Hopper",
      "phone": "+15555550124",
      "externalId": "bulk-{{$guid}}"
    }
  ]
}'
```

**Node**

```node
const res = await fetch("https://payments-api-sandbox.merchantservicedepot.com/v1/bulk_jobs/customers", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MYELA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "items": [
      {
        "email": "grace-{{$guid}}@example.com",
        "name": "Grace Hopper",
        "phone": "+15555550124",
        "externalId": "bulk-{{$guid}}"
      }
    ]
  }),
});

if (!res.ok) {
  const { error } = await res.json();
  // Branch on error.code — never on error.message.
  throw new Error(error.code);
}
const data = await res.json();
```

**Python**

```python
import os
import requests

res = requests.post(
    "https://payments-api-sandbox.merchantservicedepot.com/v1/bulk_jobs/customers",
    headers={
        "Authorization": f"Bearer {os.environ['MYELA_API_KEY']}",
    },
    json={
        "items": [
            {
                "email": "grace-{{$guid}}@example.com",
                "name": "Grace Hopper",
                "phone": "+15555550124",
                "externalId": "bulk-{{$guid}}"
            }
        ]
    },
)

if not res.ok:
    # Branch on error["code"] — never on error["message"].
    raise RuntimeError(res.json()["error"]["code"])
data = res.json()
```

## Response

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | Unique bulk job identifier. |
| `object` | "bulk_job" | Stable resource discriminator. |
| `type` | string | Which single-item operation every row runs: customers.create, payments.capture or invoices.schedule (create, then schedule). |
| `status` | string | pending, processing, completed, completed_with_errors or failed. |
| `totalItems` | integer | Rows submitted. |
| `processedItems` | integer | Rows that reached a final state. |
| `succeededItems` | integer | Rows whose operation succeeded. |
| `failedItems` | integer | Rows refused definitively. |
| `unresolvedItems` | integer | Rows to resume: a capture whose money outcome must be reconciled first, or an invoice row stopped by a temporary problem. |
| `expiresAt` | string | When the job can no longer be resumed. |
| `createdAt` | string | When the job was created. |
| `items` | array | One entry per row: its number, status, the created or captured resource on success, or a code and message on failure. A refused invoice row adds error.detailCode, the code single create returns in details.code, and still names its invoice in result if one was created. |
| `warning` | object | Only when an invoices job is created on an environment with no automatic collection: code INVOICE_SCHEDULER_DISABLED and a message. The invoices are scheduled, but nothing will charge them on its own. |

```json
{
  "id": "bj_01JEXAMPLE",
  "object": "bulk_job",
  "type": "payments.capture",
  "status": "completed_with_errors",
  "totalItems": 3,
  "processedItems": 3,
  "succeededItems": 2,
  "failedItems": 0,
  "unresolvedItems": 1,
  "expiresAt": "2026-09-05T00:00:00.000Z",
  "createdAt": "2026-09-04T00:00:00.000Z",
  "items": [
    {
      "row": 1,
      "status": "succeeded",
      "result": {
        "id": "pay_01JEXAMPLE",
        "status": "pending_settlement"
      }
    }
  ],
  "warning": {
    "code": "INVOICE_SCHEDULER_DISABLED",
    "message": "Automatic collection is not running on this environment."
  }
}
```

Source: https://docs.merchantservicedepot.com/api-reference/bulk-create-customers/
