---
updatedAt: 2026-08-27T12:47:20.000Z
agentTools:
  projectIndex: https://b2brouter.readme.io/llms.txt
---

# Cancel a Peppol migration code

Cancels the migration code of the account, so it can no longer be used to claim the identifier. This is the only call that sets `migration_pending` back to `false` on the `peppol` transport.

Cancelling re-claims the identifier at the Peppol SML, so it is a real operation and not a local reset. Use it to withdraw a code that was issued by mistake, or together with `POST` to replace an outstanding code. On a `5xx` response the cancellation may have been partially applied: retry the `DELETE` until it returns `200`.

The response is the same whether or not a code was outstanding. Requires the `transports` section with the `edit` capacity.


# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "B2Brouter API",
    "description": "The B2Brouter API allows you to send and receive electronic documents.",
    "version": "2026-06-26",
    "contact": {
      "name": "Service Delivery Team",
      "email": "servicedelivery@b2brouter.net"
    }
  },
  "servers": [
    {
      "url": "https://api-staging.b2brouter.net",
      "description": "Test server"
    },
    {
      "url": "https://api.b2brouter.net",
      "description": "Production server"
    }
  ],
  "tags": [
    {
      "name": "Transports",
      "description": "Related to transport configurations"
    }
  ],
  "paths": {
    "/accounts/{account}/transports/peppol/migration_code": {
      "delete": {
        "operationId": "delete-peppol-migration-code",
        "tags": [
          "Transports"
        ],
        "summary": "Cancel a Peppol migration code",
        "description": "Cancels the migration code of the account, so it can no longer be used to claim the identifier. This is the only call that sets `migration_pending` back to `false` on the `peppol` transport.\n\nCancelling re-claims the identifier at the Peppol SML, so it is a real operation and not a local reset. Use it to withdraw a code that was issued by mistake, or together with `POST` to replace an outstanding code. On a `5xx` response the cancellation may have been partially applied: retry the `DELETE` until it returns `200`.\n\nThe response is the same whether or not a code was outstanding. Requires the `transports` section with the `edit` capacity.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/account"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "migration_code",
                    "cancelled"
                  ],
                  "properties": {
                    "migration_code": {
                      "type": "string",
                      "nullable": true,
                      "example": null,
                      "description": "Always `null`; no code is outstanding any more."
                    },
                    "cancelled": {
                      "type": "boolean",
                      "example": true,
                      "description": "Indicates the migration code was cancelled."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "The account has no `peppol` transport (`resource_missing`).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "No migration code can be cancelled:\n\n- `conflict` — the Peppol transport of this account is not managed through the API.\n- `migration_unavailable` — migration codes are not available in the sandbox.\n- `not_published_by_b2brouter` — the identifier is not published by B2Brouter, so there is no migration to cancel.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "The Peppol SML refused the request (`sml_rejected`). The message carries the refusal.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The Peppol SML could not be reached: `sml_lookup_failed` while checking the publication state, or `sml_unavailable` while cancelling the code. Retry later.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "description": "API Key of your account",
        "name": "X-B2B-API-Key",
        "in": "header"
      }
    },
    "parameters": {
      "account": {
        "name": "account",
        "in": "path",
        "description": "Account identifier (ID)",
        "required": true,
        "schema": {
          "type": "string"
        },
        "example": "my-account"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Represents an error object returned in a failed request",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "A unique error code identifying the type of error. See https://developer.b2brouter.net/docs/error_codes for the full code list.",
                "example": "parameter_empty"
              },
              "message": {
                "type": "string",
                "description": "A human-readable error message providing more context about the error.",
                "example": "The parameter 'param' is missing or the value is empty"
              },
              "param": {
                "type": "string",
                "description": "The parameter in the request that caused the error (if applicable).",
                "example": "param"
              },
              "type": {
                "type": "string",
                "description": "The type of error. Currently the only possible value is \"invalid_request_error\".",
                "example": "invalid_request"
              }
            }
          }
        }
      },
      "UnauthorizedError": {
        "type": "object",
        "description": "Represents an error object returned in a failed request",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "A unique error code identifying the type of error.",
                "example": "unauthorized",
                "default": "unauthorized"
              },
              "message": {
                "type": "string",
                "description": "A human-readable error message providing more context about the error.",
                "example": "Invalid API Key provided, or the API key might not have the necessary permissions for this action."
              },
              "type": {
                "type": "string",
                "description": "The type of error, often mirrors the error code for clarity.",
                "example": "invalid_request_error",
                "default": "invalid_request_error"
              }
            }
          }
        }
      },
      "ForbiddenError": {
        "type": "object",
        "description": "Represents an error object returned when the target project is archived",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "A unique error code identifying the type of error.",
                "example": "403",
                "default": "403"
              },
              "message": {
                "type": "string",
                "description": "A human-readable error message providing more context about the error.",
                "example": "The project you are trying to access has been archived."
              },
              "type": {
                "type": "string",
                "description": "The type of error, often mirrors the error code for clarity.",
                "example": "invalid_request_error",
                "default": "invalid_request_error"
              }
            }
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/UnauthorizedError"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ForbiddenError"
            }
          }
        }
      }
    }
  }
}
```