---
updatedAt: 2026-04-20T20:05:09.000Z
agentTools:
  projectIndex: https://docs.prahsys.com/llms.txt
---

# Purge Sandbox Data

Delete **sandbox** data for the specified merchant. This endpoint allows deletion of different entity types related to merchants.
The operation is performed asynchronously and will trigger the "payments.merchant.purge" webhook upon completion.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Payments API",
    "description": "",
    "version": "1.81.0"
  },
  "servers": [
    {
      "url": "https://api.prahsys.com"
    }
  ],
  "tags": [
    {
      "name": "Merchant Purge",
      "description": ""
    }
  ],
  "components": {
    "securitySchemes": {
      "default": {
        "type": "http",
        "scheme": "bearer",
        "description": "You can retrieve your API key from your Prahsys account manager."
      }
    }
  },
  "security": [
    {
      "default": []
    }
  ],
  "paths": {
    "/payments/n1/merchant/{merchantId}/purge": {
      "post": {
        "summary": "Purge Sandbox Data",
        "operationId": "purgeSandboxData",
        "description": "Delete **sandbox** data for the specified merchant. This endpoint allows deletion of different entity types related to merchants.\nThe operation is performed asynchronously and will trigger the \"payments.merchant.purge\" webhook upon completion.",
        "parameters": [
          {
            "in": "header",
            "name": "X-Prahsys-Version",
            "description": "",
            "example": "1.0.0",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sandbox purge job queued successfully (Full Example)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": true,
                    "data": {
                      "payments": 12,
                      "customers": 8,
                      "sessions": 5,
                      "tokens": 3,
                      "exports": 2,
                      "merchantId": "Z70B874W63DW"
                    }
                  },
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true,
                      "description": "Whether the request was successful",
                      "enum": []
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "payments": {
                          "type": "integer",
                          "example": 12,
                          "description": "Number of payments deleted",
                          "enum": []
                        },
                        "customers": {
                          "type": "integer",
                          "example": 8,
                          "description": "Number of customers deleted",
                          "enum": []
                        },
                        "sessions": {
                          "type": "integer",
                          "example": 5,
                          "description": "Number of sessions deleted",
                          "enum": []
                        },
                        "tokens": {
                          "type": "integer",
                          "example": 3,
                          "description": "Number of tokens deleted",
                          "enum": []
                        },
                        "exports": {
                          "type": "integer",
                          "example": 2,
                          "description": "Number of exports deleted",
                          "enum": []
                        },
                        "merchantId": {
                          "type": "string",
                          "example": "Z70B874W63DW",
                          "description": "",
                          "enum": []
                        }
                      },
                      "description": "The data returned from the request"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error response (Validation Error Example)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": false,
                    "message": "The field1 is required (and one other error)",
                    "errors": {
                      "field1": [
                        "The field1 is required."
                      ],
                      "field2": [
                        "The field2 must be a valid value."
                      ]
                    }
                  },
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false,
                      "description": "Whether the request was successful",
                      "enum": []
                    },
                    "message": {
                      "type": "string",
                      "example": "The field1 is required (and one other error)",
                      "description": "A message describing the result of the request",
                      "enum": []
                    },
                    "errors": {
                      "type": "object",
                      "properties": {
                        "field1": {
                          "type": "array",
                          "example": [
                            "The field1 is required."
                          ],
                          "items": {
                            "type": "string"
                          }
                        },
                        "field2": {
                          "type": "array",
                          "example": [
                            "The field2 must be a valid value."
                          ],
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "description": "Any errors that occurred during the request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authorization error response (Unauthorized Example)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": false,
                    "message": "Authentication is required"
                  },
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false,
                      "description": "Whether the request was successful",
                      "enum": []
                    },
                    "message": {
                      "type": "string",
                      "example": "Authentication is required",
                      "description": "A message describing the result of the request",
                      "enum": []
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Error response (Server Error Example)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": false,
                    "message": "Internal Server Error"
                  },
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false,
                      "description": "Whether the request was successful",
                      "enum": []
                    },
                    "message": {
                      "type": "string",
                      "example": "Internal Server Error",
                      "description": "A message describing the result of the request",
                      "enum": []
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Merchant Purge"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "payments": {
                    "type": "boolean",
                    "description": "Delete all merchant payments",
                    "example": true,
                    "nullable": true
                  },
                  "customers": {
                    "type": "boolean",
                    "description": "Delete all merchant customers",
                    "example": true,
                    "nullable": true
                  },
                  "sessions": {
                    "type": "boolean",
                    "description": "Delete all merchant sessions",
                    "example": true,
                    "nullable": true
                  },
                  "tokens": {
                    "type": "boolean",
                    "description": "Delete all merchant tokens",
                    "example": true,
                    "nullable": true
                  },
                  "exports": {
                    "type": "boolean",
                    "description": "Delete all merchant exports",
                    "example": false,
                    "nullable": true
                  }
                }
              }
            }
          }
        }
      },
      "parameters": [
        {
          "in": "path",
          "name": "merchantId",
          "description": "The merchant ID",
          "example": "Z70B874W63DW",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ]
    }
  }
}
```