Payment methods

Payment methods drive checkout and invoice payment recording.

The payment methods model

Properties

  • Name
    id
    Type
    string
    Description

    Payment method UUID.

  • Name
    name
    Type
    string
    Description

    Display label.

  • Name
    type
    Type
    string
    Description

    Method type enum.


GET/api/payment-methods

List methods

All methods for the organization.

Request

GET
/api/payment-methods
curl -X GET http://localhost:3000/api/payment-methods \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Cash",
      "type": "CASH",
      "sortOrder": 0,
      "isActive": true
    },
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "name": "Card",
      "type": "CARD",
      "sortOrder": 1,
      "isActive": true
    }
  ]
}

POST/api/payment-methods

Create method

Add a new payment method.

Request

POST
/api/payment-methods
curl -X POST http://localhost:3000/api/payment-methods \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "FPX",
  "type": "OTHER",
  "sortOrder": 2
}

PATCH/api/payment-methods/:id

Update method

Rename or configure method.

Request

PATCH
/api/payment-methods/:id
curl -X PATCH http://localhost:3000/api/payment-methods/:id \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Cash",
  "isActive": true
}

POST/api/payment-methods/reorder

Reorder

Set display order.

Request

POST
/api/payment-methods/reorder
curl -X POST http://localhost:3000/api/payment-methods/reorder \
  -H "Authorization: Bearer YOUR_JWT"

Response

{
  "ok": true
}

Was this page helpful?