Skip to content
You are reading the unreleased documentation. No version is released yet, and these pages describe code that is not in a release.

Payment methods (admin API)

Admin routes of the payment methods module. Every route needs a staff session and the permission named on it; send X-Resolve-Locale: false to receive every locale of a translatable field for editing.

List payment methods

Parameters:

  • isActive in query (boolean, optional).
  • page in query (number, min 1, optional).
  • pageSize in query (number, min 1, max 100, optional).
  • provider in query ("stripe", "paypal", "cod", "manual", "gift_card", optional).

Responses:

  • 200: Methods retrieved.
  • 401: Unauthorized.
  • 403: Insufficient permissions.

Create payment method

Request body: CreatePaymentMethodDto.

Responses:

  • 201: Created.
  • 400: Invalid input.
  • 409: Code already in use.

Soft-delete payment method

Parameters:

  • id in path (string, required).

Responses:

  • 204: Deleted.
  • 404: Not found.

Get payment method

Parameters:

  • id in path (string, required).

Responses:

  • 200: Method retrieved.
  • 404: Not found.

Update payment method

Parameters:

  • id in path (string, required).

Request body: UpdatePaymentMethodDto.

Responses:

  • 200: Updated.
  • 400: Invalid input.
  • 404: Not found.

Reorder payment methods

Request body: ReorderPaymentMethodsDto.

Responses:

  • 204: Reordered.
  • 400: Invalid ids payload.
  • 404: One or more ids unknown.
  • code (string, pattern /^[a-z0-9_]+$/, min length 2, max length 50, required).
  • name (PaymentTranslatableDto, required).
  • description (OptionalTranslatableDto, optional).
  • provider ("stripe", "paypal", "cod", "manual", "gift_card", required).
  • isActive (boolean, optional).
  • isTestMode (boolean, optional).
  • sortOrder (number, min 0, optional).
  • config (object, optional).
  • default (string, optional).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).
  • default (string, required).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).
  • ids (array of string, required).