xBillion API
Home
Home
  1. Payments
  • xBillion
    • Introduction
    • Authentication
    • Webhhoks
    • API
      • Payments
        • Get information
          GET
        • Create payment
          POST
  1. Payments

Create payment

POST
/api/v1/payments
Transactions
Create payment transaction

Request

Body Params application/json
amount
number 
required
Transaction amount
>= 0.01
currency
enum<string> 
required
Currency in which the payment is invoiced, 3-letter code in ISO 4217 format
<= 3 characters
Allowed values:
USDEURGBPCNYRUBKZTCLP
Example:
USD
order_id
string 
required
Payment ID on the merchant side
<= 255 characters
service
string 
required
Text identifier of the service through which the payment is to be made
customer
object 
required
Customer information
name
string 
optional
Customer name
<= 255 characters
email
string 
required
Customer email. Required field if no value is passed to the phone field
<= 255 characters
phone
string 
optional
Customer phone number in international format. Required field if no value is passed to the email field
<= 30 characters
Example:
+11234567890
ip
string 
required
Customer ip
<= 20 characters
return_urls
object 
optional
URLs to which the user should be redirected upon transaction finish
fail
string 
optional
URL to redirect user after failed transaction. If not specified in the request, it will be taken from the merchant settings.
<= 255 characters
success
string 
optional
URL to redirect user after transaction successfully completed. If not specified in the request, it will be taken from the merchant settings.
<= 255 characters
webhook_url
string 
optional
URL for sending notification when transaction status will change. If not specified in the request, it will be taken from the merchant settings.
<= 255 characters
Example
{
    "amount": 0.01,
    "currency": "USD",
    "order_id": "string",
    "service": "string",
    "customer": {
        "name": "string",
        "email": "string",
        "phone": "+11234567890",
        "ip": "string"
    },
    "return_urls": {
        "fail": "string",
        "success": "string"
    },
    "webhook_url": "string"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://prod.your-api-server.com/api/v1/payments' \
--header 'Content-Type: application/json' \
--data-raw '{
    "amount": 0.01,
    "currency": "USD",
    "order_id": "string",
    "service": "string",
    "customer": {
        "name": "string",
        "email": "string",
        "phone": "+11234567890",
        "ip": "string"
    },
    "return_urls": {
        "fail": "string",
        "success": "string"
    },
    "webhook_url": "string"
}'

Responses

🟢200Payment creation result.
application/json
Body
id
string 
optional
Transaction ID on the xBillion service side
amount
object (CreatePayinResponseAmount) 
optional
Contains information about the amount to be processed on the payment system side
value
number 
required
Amount to be processed on the payment xBillion side
currency
string 
required
Currency of the amount to be processed on the payment system side. 3-letter code in ISO 4217 format.
fees
#/definitions/2717384
optional
Contains information on transaction fees
Could not resolve '#/definitions/2717384'
next
object (PayinResponseNext) 
optional
Contains information about the next action to be performed on the merchant's side
action
enum<string> 
required
Target action to be performed on the merchant's side to continue payment processing
Allowed values:
show_detailsredirect
redirect_url
string 
optional
URL to redirect the user to continue payment processing. Returned only if the value in the action field is equal to redirect
details
object 
optional
Additional payment information for displaing for user. Returned only if the value in the action field is equal to show_details
status
string 
optional
Transaction status
created_at
string 
optional
Transaction creation time in RFC-3339 format
Example
🟠400Bad request
🟠401Merchant is unauthorized.
🟠422Request for payment creation rejected by the payment system.
🔴500Internal error.
Previous
Get information
Built with