Preview: the API is being built and these endpoints may change

POST/api/v1/vend

Sell by plan code

Sell any phone plan by its code, for callers that already send a plan id.

Sells a plan to a phone number. The plan decides the service, so one call covers airtime and data. Use the electricity and cable calls for bills.

Body

FieldTypeRequiredNotes
product_codestringyesA plan's product_code, its plan number sent as a string, or a vendor: code. serviceid and service_id are aliases
phone_numberstringyesNigerian number. receiver_phone_number, destination and phone are aliases
amountnumberairtimeNaira, at most two decimal places. A fixed plan takes no amount, or exactly its face value
networkstringnoA network code, checked against the plan. network_id is an alias
client_referencestringnoYour own reference, 1 to 128 characters, unique per mode
metadataobjectnoString values only, at most 20 keys. Returned on reads and in webhooks

Send an Idempotency-Key header with every request. The call waits for the final state; add ?wait=0 to get 202 at once.

Request

bash
curl https://api.simconnectng.com/api/v1/vend \
  -H "Authorization: Bearer $SIMCONNECT_KEY" \
  -H "Idempotency-Key: order_1044" \
  -H "Content-Type: application/json" \
  -d '{ "product_code": "MTN-SHARE-1GB-30D", "phone_number": "08012345678", "client_reference": "order_1044" }'

Response

The same sale as Buy data.

Error

json
{ "success": false, "data": null, "message": "Insufficient wallet balance", "code": "WALLET_INSUFFICIENT_FUNDS" }

Give this to your coding agent

prompt
Read https://simconnectng.com/docs/api/vend.md and implement "Sell by plan code" (POST /api/v1/vend) in this project.
Read the API key from the SIMCONNECT_KEY environment variable.
Send an Idempotency-Key derived from our own order id.
Every response is { success, data, message, code }; on an error data is null (or carries data.errors), so branch on code.