url.type sets how the client pays: in the Freedom SuperApp (superapp), with Bybit Pay (bybit) or Binance Pay (binance).url for the client or send it. For superapp, the QR code qr_code is also returned.external_id must be unique: it protects against duplicate invoices. A repeated X-Request-Id does not.state_callback to get a notification when the status of the invoice changes. Without it, get the status with Status.X-JWS-Signature: see Overview.| HTTP | Meaning | Next step |
|---|---|---|
201 | The invoice is created: status = new. | Give the client url, then follow the status. |
201 | status = error: the payment system did not create the payment. | Create a new invoice with a new external_id. If it repeats, contact Freedom Pay support. |
400, 401, 422, 500 | The request is rejected. | See «Errors» below. |
error_description; error_code is returned only for 401 and 422.| HTTP | error_code | When | What to do |
|---|---|---|---|
400 | — | An invoice with this external_id already exists. | Use a new external_id, or get the existing invoice with Info. |
401 | 9998 | The signature is invalid. | Check the signature: see Overview. |
422 | 9403 | The X-JWS-Signature header is missing. | Pass the signature. |
500 | — | A field is missing or invalid, X-Request-Id is not a UUID, or an internal error occurred. error_description names the field. | Fix the request. If the request is valid, repeat it later with a new X-Request-Id. |