OuiPay
API ReferenceServices

Create a quote

POST /v1/services/quote : lock the customer price, fee, and FX for a service purchase.

POST /v1/services/quote

Prices a service purchase before the customer commits. The quote locks the destination amount, the OuiPay fee, and (for cross-currency orders) the FX rate, and returns a quote_id to bind on order creation.

Quotes are optional for same-currency orders but required after any FX: an order whose service country currency differs from the customer's paying currency must carry a live quote_id.

Headers

HeaderRequiredValue
AuthorizationyesBearer sk_...
Content-Typeyesapplication/json

Body

FieldTypeRequiredNotes
provider_cost_minorintyesDestination service value, minor units
currencystringyesCurrency of provider_cost_minor (ISO 4217)
country_codestringyesService country
service_codestringyesCatalogue code
payment_methodstringnoIntended method: fees can differ per method
phonestringnoRecipient phone when it affects pricing
account_refstringnoRecipient account when it affects pricing

For fixed-price plans, provider_cost_minor is the plan's amount_minor. For open-amount services it is the amount the customer entered.

Request

curl https://api.ouipay.africa/v1/services/quote \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "provider_cost_minor": 500000,
    "currency": "NGN",
    "country_code": "NG",
    "service_code": "electricity",
    "payment_method": "wallet"
  }'

Response 200

{
  "data": {
    "quote_id": "01M2S17...",
    "source_currency": "NGN",
    "destination_currency": "NGN",
    "destination_amount_minor": 500000,
    "converted_amount_minor": 500000,
    "fee_minor": 10000,
    "customer_amount_minor": 510000,
    "currency": "NGN",
    "provider_cost_minor": 500000,
    "fx_rate": null,
    "cross_currency": false,
    "promotion_discount_minor": 0,
    "promotion_code": null,
    "expires_at": "2026-09-18T02:05:00Z"
  }
}
FieldTypeNotes
quote_idstringBind on POST /services/orders
customer_amount_minorintWhat the customer pays: converted_amount_minor + fee_minor
converted_amount_minorintDestination value converted into source_currency
destination_amount_minorintThe service value delivered, in destination_currency
fx_ratestringLocked customer rate when cross_currency is true
cross_currencybooleanCustomer pays a different currency than the destination
expires_atstringOrders against an expired quote are rejected

Show customer_amount_minor, fee_minor, and (when cross-currency) fx_rate on the review screen. These are the locked terms: the order cannot reprice.

Errors

HTTPerror.codeCause
400VALIDATIONMissing or malformed field
403SERVICE_COUNTRY_NOT_ELIGIBLECountry not eligible for this account
422SERVICE_UNAVAILABLEService not offered in the requested country