Orders

Ask for another code, or another number

What this does depends on the order, and the response shape follows it:

  • Resend — the same number is asked for a fresh code. Response carries message.
  • Swap — the order keeps its id but gets a new number. Response carries phone_number and a refreshed expires_at. can_swap_number on the order tells you in advance which behaviour you will get.

Valid only while the order is waiting or created.

Also served as POST /api/v1/order/{id}/retry.

post/api/v1/orders/{id}/retry

Request

  • Base URL: https://virtualsms.io
  • URL: https://virtualsms.io/api/v1/orders/{id}/retry
  • Auth: one of:
    • API key in header X-API-Key
    • API key in query parameter api_key

Path parameters

idstring uuid required

Request body

swap_to_standardboolean

Only meaningful on an order eligible for a number swap: ask for a Standard replacement instead of a like-for-like one. The price difference is credited to your balance and returned as credit.

Response

Accepted. Which fields are present depends on whether the order resent to the same number or was given a new one.

successboolean
order_idstring uuid
messagestring

Present on a resend.

phone_numberstring

Present when the number was swapped — this is the new one.

expires_atstring

Present when the number was swapped.

creditnumber float

Present on a swap_to_standard downgrade.

balancenumber float

Present on a swap_to_standard downgrade.

Example response

{
  "message": "New SMS code requested"
}

Changes

No recorded changes to this operation across all 1 revision of this API.