Skip to main content

Create Payment Method

curl -X POST https://api.example.com/pagos \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Tarjeta de Crédito"
  }'
{
  "id": 1,
  "nombre": "Tarjeta de Crédito"
}

Request Body

nombre
string
required
Payment method name (e.g., “Efectivo”, “Tarjeta de Crédito”, “Tarjeta de Débito”, “Transferencia Bancaria”)

Response Fields

id
number
Unique payment method identifier
nombre
string
Payment method name

List Payment Methods

curl -X GET https://api.example.com/pagos
[
  {
    "id": 1,
    "nombre": "Efectivo"
  },
  {
    "id": 2,
    "nombre": "Tarjeta de Crédito"
  },
  {
    "id": 3,
    "nombre": "Tarjeta de Débito"
  },
  {
    "id": 4,
    "nombre": "Transferencia Bancaria"
  },
  {
    "id": 5,
    "nombre": "Yape"
  },
  {
    "id": 6,
    "nombre": "Plin"
  }
]
Common payment methods in Peru include:
  • Efectivo: Cash payments
  • Tarjeta de Crédito: Credit card
  • Tarjeta de Débito: Debit card
  • Transferencia Bancaria: Bank transfer
  • Yape: Mobile payment app
  • Plin: Mobile payment app

Get Payment Method by ID

curl -X GET https://api.example.com/pagos/1
{
  "id": 1,
  "nombre": "Efectivo"
}

Path Parameters

id
number
required
Payment method ID

Update Payment Method

curl -X PUT https://api.example.com/pagos/1 \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Efectivo (Soles)"
  }'
{
  "id": 1,
  "nombre": "Efectivo (Soles)"
}

Path Parameters

id
number
required
Payment method ID to update

Request Body

nombre
string
required
Updated payment method name

Delete Payment Method

curl -X DELETE https://api.example.com/pagos/1

Path Parameters

id
number
required
Payment method ID to delete
Deleting a payment method that is referenced by existing sales or purchases may cause issues. Consider deactivating instead of deleting.

Build docs developers (and LLMs) love