POST /2024-09/merchants

Create a new merchant where the current user is the owner.

application/json

Body Required

  • name string Required

    The user-defined name of the merchant

    Maximum length is 255.

Responses

  • 201 application/json

    A successful response returning the created merchant.

    Hide response attribute Show response attribute object
    • data object

      Representation of a merchant

      Additional properties are NOT allowed.

      Hide data attributes Show data attributes object
      • name string

        The user-defined name of the merchant

        Maximum length is 255.

      • id string(uuid)

        The UUID of the resource.

      • created_at string(date-time)

        The date and time the resource was created.

      • updated_at string(date-time)

        The date and time the resource was last updated.

  • 401 application/json

    The request requires user authentication or the user is not authorized to access this resource.

    Hide response attribute Show response attribute object
    • message string
  • 422 application/json

    The request was unprocessable due to validation errors

    Hide response attributes Show response attributes object
    • message string Required
    • errors object Required

      A map of field names to arrays of error messages

      Hide errors attribute Show errors attribute object
      • * array[string] Additional properties
POST /2024-09/merchants
curl \
 --request POST 'https://app.merchanthq.com/api/2024-09/merchants' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"name":"ACME Corp"}'
Request examples
{
  "name": "ACME Corp"
}
Response examples (201)
{
  "data": {
    "name": "ACME Corp",
    "id": "1e7f0a0f-b5a9-4d1a-a2d5-d0e0c2b1c3d4",
    "created_at": "2025-01-10T10:37:11Z",
    "updated_at": "2025-01-10T10:37:11Z"
  }
}
Response examples (401)
{
  "message": "Unauthorized"
}
Response examples (422)
{
  "message": "The given data was invalid.",
  "errors": {
    "field_name": [
      "The field name field is required."
    ]
  }
}