Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Panahashi/llms.txt

Use this file to discover all available pages before exploring further.

The payments resource lets authenticated users submit a payment for a placed order and retrieve the resulting payment record. All payment endpoints require Firebase authentication.
Every payments endpoint requires an Authorization: Bearer <token> header. Calls made without a valid Firebase token will be rejected.

POST /payments — createPayment({...})

Submits a payment for an existing order. The payment is processed immediately in simulation mode.
Cards ending in 0000 are always declined in the simulation. Use any other four-digit suffix to simulate an approved payment.

Request parameters

orderId
string
required
ID of the order to pay for. The order must already exist.
method
string
required
Payment method. One of CASH_ON_PICKUP, CREDIT_CARD, DEBIT_CARD, or PSE.
simulatedCardLast4
string
Last 4 digits of the card number, used only in simulation mode. Cards ending in 0000 are declined; all other values are approved. Required when method is CREDIT_CARD or DEBIT_CARD.

Response fields

status
string
Result of the payment attempt. Typical values: APPROVED, DECLINED, PENDING.

Example

import { createPayment } from './services/api';

const payment = await createPayment({
  orderId: 'order-id-789',
  method: 'CREDIT_CARD',
  simulatedCardLast4: '1234',
});

GET /payments/order/:orderId — fetchPaymentByOrder(orderId)

Returns the payment record associated with a given order.

Request parameters

orderId
string
required
ID of the order whose payment record you want to retrieve.

Response fields

Returns the payment object for the order, with the same shape as the response from createPayment(), plus metadata such as createdAt and orderId.

Example

import { fetchPaymentByOrder } from './services/api';

const payment = await fetchPaymentByOrder('order-id-789');

Build docs developers (and LLMs) love