create-billing-transfer-end-customer-mappings
dci create-billing-transfer-end-customer-mappings
Maps end-customer AWS accounts under a reseller's PMA to their DoiT tenant, as part of AWS
billing transfer onboarding. Reseller-only; distributors are explicitly denied (403).
Unlike POST /billingtransfer/v1/resellerhandshakes, this endpoint has no
Idempotency-Key requirement and no dryRun support.
This path is a deliberate exception to the de-hyphenation convention used by the sibling
resellerhandshakes and programmanagementaccounts paths — it stays hyphenated to match
the existing Go route and its console-facing equivalent.
Each item in the batch is processed independently; per-item outcomes are returned in
results[] with HTTP 200. Malformed items are rejected up front and reported in
invalidItems without processing any of the batch.
Request
Content-Type: application/json
Schema
{
"type": "object",
"additionalProperties": false,
"required": [
"dpmaId",
"resellerPmaAccountId",
"items"
],
"properties": {
"dpmaId": {
"type": "string"
},
"resellerPmaAccountId": {
"type": "string",
"description": "12-digit AWS account ID of the reseller's program management account.",
"example": "123456789012"
},
"items": {
"type": "array",
"minItems": 1,
"maxItems": 100,
"description": "Batch items. Duplicate `ecAccountId` or `ecCustomerId` values within the batch are rejected.",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"ecAccountId",
"ecCustomerId"
],
"properties": {
"ecAccountId": {
"type": "string",
"description": "12-digit AWS account ID of the end-customer account being mapped.",
"example": "123456789012"
},
"ecCustomerId": {
"type": "string",
"description": "DoiT customer ID to map the end-customer account to."
},
"curBasePath": {
"type": "string",
"description": "Optional CUR export base path for the end-customer account."
}
}
}
}
}
}
Output
OK - Batch processed; see results for per-item outcomes and invalidItems for any items rejected before processing.
By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.
| Field | Type | Description |
|---|---|---|
dpmaId | string | |
resellerPmaAccountId | string | |
results | array of object | |
results[].ecAccountId | string | |
results[].ecCustomerId | string | |
results[].curBasePath | string | |
results[].status | string | One of: "mapped", "already_mapped", "remapped". |
invalidItems | array of object | Items rejected before processing. Omitted when every item passed validation. |
invalidItems[].index | integer | Zero-based position of the invalid item within the submitted batch. |
invalidItems[].resellerCustomerId | string | Present when the invalid item is a reseller-handshake batch item. |
invalidItems[].code | string | Stable machine-readable error code (e.g. duplicate_pma, duplicate_ec_account). |
invalidItems[].reason | string | Human-readable explanation of why the item is invalid. |
Raw JSON schema
{
"type": "object",
"additionalProperties": false,
"required": [
"dpmaId",
"resellerPmaAccountId",
"results"
],
"properties": {
"dpmaId": {
"type": "string"
},
"resellerPmaAccountId": {
"type": "string"
},
"results": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"ecAccountId",
"ecCustomerId",
"status"
],
"properties": {
"ecAccountId": {
"type": "string"
},
"ecCustomerId": {
"type": "string"
},
"curBasePath": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"mapped",
"already_mapped",
"remapped"
]
}
}
}
},
"invalidItems": {
"type": "array",
"description": "Items rejected before processing. Omitted when every item passed validation.",
"items": {
"type": "object",
"description": "A single batch item that failed validation before processing began.",
"additionalProperties": false,
"required": [
"index",
"code"
],
"properties": {
"index": {
"type": "integer",
"description": "Zero-based position of the invalid item within the submitted batch."
},
"resellerCustomerId": {
"type": "string",
"description": "Present when the invalid item is a reseller-handshake batch item."
},
"code": {
"type": "string",
"description": "Stable machine-readable error code (e.g. `duplicate_pma`, `duplicate_ec_account`).",
"example": "duplicate_pma"
},
"reason": {
"type": "string",
"description": "Human-readable explanation of why the item is invalid."
}
}
}
}
}
}
Errors
On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.
| HTTP status | Exit code | Error code | Meaning |
|---|---|---|---|
| 400, 422 | 30 | VALIDATION_ERROR | The arguments or request body were rejected. Review the command's flags and payload. |
| 401 | 10 | AUTHENTICATION_FAILED | Not signed in, or the API token is invalid. Run dci login or check DCI_API_KEY. |
| 403 | 11 | PERMISSION_DENIED | The DoiT user or the active customer context does not have access. |
| 500 | 40 | API_SERVER_ERROR | The API failed to process the request. Retryable; contact DoiT support if it persists. |
Aliases: createbillingtransferendcustomermappings