Payment Request

Creates an SMS Billing payment request and returns the page your customer pays on. Send the customer to redirect_url; you'll hear the result through postbacks and they'll be returned to your redirect_url or failed_url.

https://api.vendreo.com/v1/sms/request-payment

One-off payment

curl --location --request POST 'https://api.vendreo.com/v1/sms/request-payment' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {AUTH_TOKEN}' \
  --data-raw '{
    "application_key": "{APPLICATION_KEY}",
    "sms_product_id": "{SMS_PRODUCT_ID}",
    "amount": 1500,
    "reference_id": "123456",
    "description": "Chat credit",
    "redirect_url": "https://example.com/success",
    "failed_url": "https://example.com/failed",
    "options": "optional string"
  }'

Subscription

A subscription product charges its own price, so leave out amount.

curl --location --request POST 'https://api.vendreo.com/v1/sms/request-payment' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {AUTH_TOKEN}' \
  --data-raw '{
    "application_key": "{APPLICATION_KEY}",
    "sms_product_id": "{SMS_PRODUCT_ID}",
    "reference_id": "123456",
    "description": "VIP membership",
    "redirect_url": "https://example.com/success"
  }'

Request

  
application_keyrequired
Your SMS Billing Payment Profile's application key.
sms_product_idrequired
The ID of an active SMS Billing product, from SMS Billing → Products.
amountconditional
In pence, from 1 to 4000 (£40.00). Required for a one-off product; must be left out for a subscription.
reference_idrequired
Your own reference (session ID, order ID). Returned in every postback. Up to 255 characters.
descriptionrequired
What the customer is paying for.
redirect_urlrequired
Where the customer goes after paying.
failed_urloptional
Where the customer goes if the payment fails or expires. Defaults to redirect_url.
optionsoptional
Any string; returned in every postback.

Response

{
    "redirect_url": "https://pay.vendreo.com/sms-payment/9d41a2c6-2f0e-4c8a-9a51-2b7f0c3e8d14",
    "payment_request_id": 1201,
    "payment_request_uuid": "9d41a2c6-2f0e-4c8a-9a51-2b7f0c3e8d14",
    "meta": {
        "tracing_id": "8f3b6c1e-5d2a-4f7b-9c0e-1a2b3c4d5e6f"
    }
}

Errors

StatusWhen
403SMS Billing isn't enabled on your account, or the application key isn't an SMS Billing Payment Profile's.
422A field is missing or invalid, for example an inactive product, an amount over £40.00, or an amount sent for a subscription product.

Payment status

The status in postbacks moves through these values.

StatusMeaning
PENDINGWaiting for the customer to enter their number.
AWAITING_TEXTOn a computer: waiting for the customer to text the code word.
OPT_IN_SENTWe've texted the customer asking them to reply PAY AGREE.
OPT_IN_DELIVEREDThat text reached their phone.
CHARGINGThe customer agreed and we're charging their phone bill.
COMPLETEDPaid.
FAILEDNot paid. See failure_reason.
EXPIREDThe customer didn't reply in time.
CANCELLEDThe customer started again with another number, or replied STOP.

Failure reasons

failure_reasonMeaning
opt_in_not_sentWe couldn't send a text to the number.
opt_in_undeliveredThe text couldn't be delivered to the number.
no_replyThe customer didn't reply PAY AGREE in time.
no_textOn a computer, the customer didn't text the code word in time.
stopped_by_customerThe customer replied STOP.
network_not_supportedThe customer's network doesn't support phone bill payments.
amount_not_available_on_networkThe amount can't be charged on the customer's network (on Sky, amounts must be a multiple of 50p).
charge_rejectedThe network declined the charge, for example on some pay-as-you-go or business accounts.
charge_failedThe network couldn't take the payment. On Sky, this includes the customer being out of credit.
charge_request_failedWe couldn't reach the network.
no_resultThe network didn't confirm the payment within 72 hours. If it confirms later, you'll receive sms_payment_completed.
daily_capThe number has reached its £150.00 daily limit.
already_subscribedThe number already has a live subscription to this product.