Flavours API
Payment method

Create Payment Method

POST
/api/v2/payment-methods

Create a new payment method.

AuthorizationBearer <token>

You can retrieve your token by logging in.

In: header

Header Parameters

X-API-Version*string

API contract version to target. See the Changelog for what changed in each version.

Default"2.0.0"
Value in"2.3.0" | "2.2.0" | "2.1.0" | "2.0.0"

Request Body

multipart/form-data

includes*array<>
market_id?|

The id of an existing record in the markets table.

name*string

Payment method name. Must not be greater than 64 characters.

is_online*boolean

Whether the payment method is online.

logo_img*string

Payment method logo image (max 2MB). Must be an image. Must not be greater than 1024 kilobytes.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:8000/api/v2/payment-methods" \  -H "X-API-Version: 2.3.0" \  -F includes="[\n  \"quod\"\n]" \  -F name="Apple Pay" \  -F is_online="true" \  -F logo_img="string"
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Payment method created successfully."
  },
  "data": {
    "key": "APPLE_PAY_DOCS",
    "name": "Apple Pay Docs",
    "is_online": true,
    "logo_img": "https://cdn.example.com/payment-methods/apple-pay.png",
    "created_at": 1782824838673,
    "updated_at": 1782824838673,
    "scopes": [
      "SCOPE_ORDER"
    ],
    "settings_count": "0"
  }
}
{
  "meta": {
    "code": 401,
    "status": "error",
    "message": "Unauthenticated."
  },
  "data": null
}
{
  "meta": {
    "code": 403,
    "status": "error",
    "message": "Unauthorized."
  },
  "data": null
}
{
  "meta": {
    "code": 404,
    "status": "error",
    "message": "Resource not found."
  },
  "data": null
}
{
  "meta": {
    "code": 422,
    "status": "error",
    "message": "The name field is required. (and 2 more errors)"
  },
  "data": [
    {
      "code": 0,
      "message": "The name field is required.",
      "field": "name"
    },
    {
      "code": 0,
      "message": "The is online field is required.",
      "field": "is_online"
    },
    {
      "code": 0,
      "message": "The logo img must be a valid URL.",
      "field": "logo_img"
    }
  ]
}
{
  "meta": {
    "code": 500,
    "status": "error",
    "message": "Internal server error."
  },
  "data": null
}