---
updatedAt: 2026-10-13T14:01:13.000Z
agentTools:
  projectIndex: https://developer.doit.com/llms.txt
---

# Create reseller handshakes (batch)

Maps reseller to distributor; also sends the handshake if required, as part of AWS
billing transfer onboarding. Distributor-only; callers without the ChannelOps distributor
tier entitlement receive `403`.

Each item in the batch is processed independently; per-item outcomes are returned in
`results[]` with HTTP `200` even when some items fail. Malformed items (missing fields,
duplicate `resellerPmaAccountId` within the batch) are rejected up front with `422` and
reported in `invalidItems`, and none of the batch is processed in that case.


# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "DoiT Cloud Intelligence",
    "description": "Programmatic access to DoiT Platform",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.doit.com"
    }
  ],
  "security": [
    {
      "api_key": []
    },
    {
      "tenantId": [],
      "api_key": []
    }
  ],
  "tags": [
    {
      "name": "Billing Transfer",
      "description": "Manage AWS billing-transfer mappings between distributors and resellers and between resellers and end customers, and list program management accounts."
    }
  ],
  "paths": {
    "/billingtransfer/v1/resellerhandshakes": {
      "post": {
        "tags": [
          "Billing Transfer"
        ],
        "summary": "Create reseller handshakes (batch)",
        "description": "Maps reseller to distributor; also sends the handshake if required, as part of AWS\nbilling transfer onboarding. Distributor-only; callers without the ChannelOps distributor\ntier entitlement receive `403`.\n\nEach item in the batch is processed independently; per-item outcomes are returned in\n`results[]` with HTTP `200` even when some items fail. Malformed items (missing fields,\nduplicate `resellerPmaAccountId` within the batch) are rejected up front with `422` and\nreported in `invalidItems`, and none of the batch is processed in that case.\n",
        "operationId": "createBillingTransferResellerHandshakes",
        "parameters": [
          {
            "$ref": "#/components/parameters/tenantId"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Client-generated idempotency key (UUID v4 or ULID recommended, max 255 characters).\nRe-submitting the same key with the same request returns the cached response without\nre-executing side effects.\n",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "dryRun",
            "in": "query",
            "required": false,
            "description": "If `true`, validates the batch and simulates the outcome without issuing any AWS\nOrganizations handshakes. The response shape is identical to a real execution.\n",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResellerHandshakeBatchCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK - Batch processed; see `results` and `summary` for per-item outcomes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResellerHandshakeBatchResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "description": "Forbidden - The caller is not entitled to the ChannelOps distributor tier, or does not own the referenced `dpmaId`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingTransferProblemDetails"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/422_billing_transfer_batch_validation"
          },
          "500": {
            "$ref": "#/components/responses/500"
          },
          "502": {
            "description": "Bad Gateway - AWS Organizations was unreachable; retry later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingTransferProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Standard error response structure.",
        "properties": {
          "error": {
            "type": "string",
            "description": "Detailed error message."
          }
        },
        "example": {
          "error": "The request could not be completed."
        }
      },
      "BillingTransferProblemDetails": {
        "type": "object",
        "description": "RFC 7807 problem-detail body returned by Billing Transfer endpoints for 4xx/5xx errors.",
        "additionalProperties": false,
        "required": [
          "type",
          "title",
          "status",
          "code"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "A URI identifying the problem type."
          },
          "title": {
            "type": "string",
            "description": "Short, human-readable summary of the problem type."
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status code repeated in the body."
          },
          "detail": {
            "type": "string",
            "description": "Human-readable explanation specific to this occurrence of the problem."
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable error code.",
            "example": "billing-transfer.batch_validation_failed"
          },
          "retryable": {
            "type": "boolean",
            "description": "Whether retrying the same request may succeed without changes."
          },
          "invalidItems": {
            "type": "array",
            "description": "Present on batch-validation failures; the batch items that failed validation.",
            "items": {
              "$ref": "#/components/schemas/InvalidHandshakeItem"
            }
          }
        }
      },
      "InvalidHandshakeItem": {
        "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."
          }
        }
      },
      "HandshakeState": {
        "type": "string",
        "description": "AWS Organizations Handshake `State` value, lowercased.",
        "enum": [
          "requested",
          "open",
          "canceled",
          "accepted",
          "declined",
          "expired"
        ]
      },
      "ResellerHandshakeItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "resellerCustomerId",
          "resellerPmaAccountId"
        ],
        "properties": {
          "resellerCustomerId": {
            "type": "string",
            "description": "DoiT customer ID of the reseller's end customer to issue a handshake for."
          },
          "resellerPmaAccountId": {
            "type": "string",
            "description": "12-digit AWS account ID of the reseller's program management account (PMA).",
            "example": "123456789012"
          }
        }
      },
      "ResellerHandshakeBatchCreate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dpmaId",
          "items"
        ],
        "properties": {
          "dpmaId": {
            "type": "string",
            "description": "The distributor's program management account (DPMA) ID issuing the handshakes."
          },
          "sendHandshakes": {
            "type": "boolean",
            "description": "If `true`, issues a new AWS Organizations handshake for each item without an existing one. If omitted or `false`, maps the batch in place without issuing any AWS Organizations handshakes.",
            "default": false
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "description": "Batch items. Duplicate `resellerPmaAccountId` values within the batch are rejected.",
            "items": {
              "$ref": "#/components/schemas/ResellerHandshakeItem"
            }
          }
        }
      },
      "ResellerHandshakeError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable machine-readable error code for this item."
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation of the failure."
          }
        }
      },
      "ResellerHandshakeStatus": {
        "type": "string",
        "description": "Outcome of processing this batch item.",
        "enum": [
          "handshake_issued",
          "no_op",
          "mapped",
          "remapped",
          "failed"
        ]
      },
      "ResellerHandshakeResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "resellerCustomerId",
          "resellerPmaAccountId",
          "status"
        ],
        "properties": {
          "resellerCustomerId": {
            "type": "string"
          },
          "resellerPmaAccountId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ResellerHandshakeStatus"
          },
          "handshakeId": {
            "type": "string",
            "description": "AWS Organizations handshake ID. Absent when no handshake was issued (e.g. `no_op`, `failed`, or dry run)."
          },
          "handshakeState": {
            "$ref": "#/components/schemas/HandshakeState"
          },
          "error": {
            "$ref": "#/components/schemas/ResellerHandshakeError"
          }
        }
      },
      "ResellerHandshakeBatchSummary": {
        "type": "object",
        "description": "Per-outcome counts across the batch. Field names are snake_case, matching the actual wire format returned by this endpoint — an intentional inconsistency with the rest of the payload, which is camelCase.",
        "additionalProperties": false,
        "required": [
          "handshake_issued",
          "no_op",
          "mapped",
          "remapped",
          "failed"
        ],
        "properties": {
          "handshake_issued": {
            "type": "integer"
          },
          "no_op": {
            "type": "integer"
          },
          "mapped": {
            "type": "integer"
          },
          "remapped": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          }
        }
      },
      "ResellerHandshakeBatchResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dpmaId",
          "results",
          "summary"
        ],
        "properties": {
          "dpmaId": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResellerHandshakeResult"
            }
          },
          "summary": {
            "$ref": "#/components/schemas/ResellerHandshakeBatchSummary"
          }
        }
      }
    },
    "responses": {
      "400": {
        "description": "Bad Request - The server cannot process the request, often due to a malformed request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "401": {
        "description": "Unauthorized - Invalid API key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "500": {
        "description": "Internal Server Error - Something went wrong with the DoiT API server.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "422_billing_transfer_batch_validation": {
        "description": "Unprocessable Entity - One or more items in the batch failed validation before any processing began (missing required fields, or duplicate account/customer IDs within the batch), or a batch-level field such as `dpmaId` is missing or invalid. None of the batch was processed; resubmit with corrected `items`. Invalid items are listed in `invalidItems`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BillingTransferProblemDetails"
            }
          }
        }
      }
    },
    "parameters": {
      "tenantId": {
        "in": "header",
        "name": "X-Tenant-Id",
        "required": false,
        "description": "Customer (tenant) ID for the request. This is separate from authentication: you still pass your personal or service account API token in the `Authorization` header (`Bearer <token>`). See [Get Started](https://developer.doit.com/docs/start).\n\n**When to omit (most callers):** If your personal or service account token belongs to a single customer, omit this header. The API resolves that customer from the token.\n\n**When to send:** If your credential can access more than one customer, set `X-Tenant-Id` to the customer ID you want to act on. A service account can select an active direct or nested descendant of its home customer; the endpoint's normal permissions, entitlements, and resource-ownership checks still apply. A service-account target outside that customer subtree returns `403 Forbidden`. Prefer this header over the legacy `customerContext` query parameter, which only applies to legacy API keys and is ignored by personal and service account tokens.",
        "schema": {
          "type": "string",
          "example": "Kp2mN8qL4vR0sT1wX3yZ"
        }
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "Authorization",
        "description": "Use the \"Bearer <API_KEY>\" format or sign in for autofill",
        "in": "header"
      },
      "tenantId": {
        "type": "apiKey",
        "name": "X-Tenant-Id",
        "description": "Customer (tenant) ID for the request. Separate from your API token: always authenticate with `Authorization: Bearer <token>` (personal or service account). See [Get Started](https://developer.doit.com/docs/start). Omit when your token is scoped to a single customer (resolved automatically). A service account can select an active direct or nested descendant of its home customer; the endpoint's normal permissions, entitlements, and resource-ownership checks still apply. A service-account target outside that customer subtree returns `403 Forbidden`. Prefer this header over the legacy `customerContext` query parameter, which only applies to legacy API keys and is ignored by personal and service account tokens.",
        "in": "header"
      }
    }
  },
  "x-samples-languages": [
    "curl",
    "go",
    "node",
    "python"
  ],
  "x-cli-config": {
    "security": "oauth2",
    "params": {
      "client_id": "cli"
    }
  }
}
```