API Reference
Reference for all status codes, types, and modes used in the API.
Constants & Enums
The API uses string-based constants to represent the state and type of various objects. When integrating, strictly use these values.
1. Virtual TPE Instances
These statuses apply to the MytpePay object (your virtual terminal).
Instance Status
status field on the Instance object.
| Value | Description |
|---|---|
pending | Initial State. Instance created but activation fee not yet paid or approved. |
processing | Fee paid, currently being provisioned by the system. |
active | Operational. Can generate links and accept payments. |
inactive | Manually disabled or archived. Cannot accept payments. |
refused | Compliance rejected the instance application. |
2. Payment Links
These constants apply to the MytpePayLink object.
Payment Modes
payment_mode field. Controls the lifecycle logic.
| Mode | Description |
|---|---|
reusable | Standard. Link never expires. Good for e-commerce products. |
one_shot | Invoice. Closes automatically after 1 successful payment. |
limited | Quota. Closes automatically after max_payments is reached. |
Pricing Types
type field. Controls how the amount is determined.
| Type | Description |
|---|---|
dynamic | Fixed Price. The merchant sets the amount. Customer pays exactly that. |
static | Donation/Custom. The customer enters the amount. |
Link Status
status field.
| Status | Description |
|---|---|
active | Link is public and accepting payments. |
inactive | Manually paused by the merchant. Users see a "Paused" message. |
closed | System Closed. Auto-closed because quota was reached or invoice was paid. |
Payment Status
payment_status field (computed). Shows the payment state of the link based on mode and transactions.
One-Shot Mode
| Status | Description |
|---|---|
awaiting_payment | Link is active, waiting for the first (and only) payment. |
paid | Payment received successfully. Link is closed with a completed transaction. |
expired | Link closed after 48h timeout without receiving payment. |
inactive | Merchant manually disabled the link before payment. |
Limited Mode
| Status | Description |
|---|---|
awaiting_payment | Link is active but no payments received yet. |
partially_paid | Some payments received, still active and accepting more. |
fully_paid | Reached max_payments quota. Link is closed. |
partially_paid_expired | Some payments received but closed due to 48h expiry before reaching quota. |
expired | Closed after 48h without any payment. |
inactive | Merchant manually disabled the link. |
Reusable Mode
| Status | Description |
|---|---|
active | Link is active and ready to receive payments (no payments yet). |
active_receiving_payments | Link is active and has received payments. |
closed_with_payments | Manually closed after receiving payments. |
closed | Manually closed without any payments. |
inactive | Merchant manually disabled the link. |
Payment Status Logic
The payment_status field helps you understand the exact state of a payment link:
- Closed + has payments = Paid (fully or partially)
- Closed + no payments = Expired (48h timeout)
- This distinction is crucial for one-shot invoices and limited inventory links.
3. Transactions
These constants apply to the object found in Webhooks and History.
Transaction Status
status field.
| Status | Description |
|---|---|
pending | Customer landed on checkout but hasn't paid yet. |
processing | Payment submitted, waiting for bank confirmation. |
completed | Success. Money has been captured. Deliver the service. |
failed | Bank rejected the card or insufficient funds. |
refunded | Merchant issued a refund for this transaction. |
refused | Blocked by anti-fraud or compliance rules. |
Payment Methods
payment_method field.
| Method | Description |
|---|---|
online | CIB / EDAHABIA. Standard card payment. |
Handling Webhooks
When processing webhooks, ensure you only fulfill orders when the transaction status is strictly completed. Do not ship items on pending or processing.