Key | Value |
---|---|
Accept | application/json |
Content-Type | application/json |
Authorization | Bearer {API-KEY} |
Create a new token for your customer.
Method | URI |
---|---|
POST | /tokenizations/create-token |
KEY | TYPE | RULE | DESCRIPTION |
---|---|---|---|
email |
required |
The email address of the payer | |
phone_no | string |
optional |
The phone number of the payer |
redirect_url | string |
optional |
A URL where will be redirected after payment has been made. If no URL is sent, it will be redirected to the Swipe thank you page |
title | string |
required |
The token title with no greater than 50 characters |
description | string |
required |
The description of token |
{
"email": "test@email.com",
"phone_no": "0123456789",
"redirect_url": "https://swipego.io/",
"title": "Lorem Ipsum",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
}
{success} Success Response
Code 200
Response
{
"success": true,
"data": {
"email": "test@email.com",
"phone_no": "0123456789",
"redirect_url": "https://swipego.io/",
"title": "Lorem Ipsum",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
"token": "c1e3a6b219fcd8b4adb98f1f05130f359804ad7befd5b976f1412e734dad5736",
"updated_at": "2022-05-19T08:36:38.897000Z",
"created_at": "2022-05-19T08:36:38.897000Z",
"_id": "628601960641c9fdff637f3a",
"activation_url": "http://localhost:8080/tokenization/activation/c1e3a6b219fcd8b4adb98f1f05130f359804ad7befd5b976f1412e734dad5736?test=true"
},
"errors": null,
"meta": {
"timestamp": "2022-05-19 08:36:38 UTC",
"timezone": "UTC"
}
}
{danger} Error Response
Code 422
Response
{
"message": "The given data was invalid.",
"errors": {
"email": [
"The email field is required."
],
"title": [
"The title field is required."
],
"description": [
"The description field is required."
]
}
}