Send a payment request
curl --request POST \
--url https://lazyapp.in/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "+919812345670",
"body": "<string>",
"items": [
{
"name": "<string>",
"amount": 2,
"quantity": 5000,
"sale_amount": 2,
"retailer_id": "<string>",
"image_url": "<string>",
"country_of_origin": "<string>",
"importer_name": "<string>",
"importer_address": {}
}
],
"payment": {
"configuration": "<string>",
"gateway_account": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"upi_intent_link": "<string>",
"payment_link": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"enabled_payment_options": [],
"gateway_fields": {}
},
"phone_number_id": "<string>",
"reference_id": "<string>",
"footer": "<string>",
"header_image_url": "<string>",
"catalog_id": "<string>",
"expires_in_minutes": 21602,
"expiry_description": "<string>",
"importer": {
"name": "<string>",
"country_of_origin": "<string>",
"address": {
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"zone_code": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
}
},
"beneficiary": {
"name": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
},
"tax": {
"amount": 123,
"description": "<string>"
},
"shipping": {
"amount": 123,
"description": "<string>"
},
"discount": {
"amount": 123,
"description": "<string>",
"program_name": "<string>"
},
"template": {
"name": "<string>",
"language": "<string>",
"button_index": 123,
"components": [
{}
]
},
"metadata": {}
}
'import requests
url = "https://lazyapp.in/v1/payments"
payload = {
"to": "+919812345670",
"body": "<string>",
"items": [
{
"name": "<string>",
"amount": 2,
"quantity": 5000,
"sale_amount": 2,
"retailer_id": "<string>",
"image_url": "<string>",
"country_of_origin": "<string>",
"importer_name": "<string>",
"importer_address": {}
}
],
"payment": {
"configuration": "<string>",
"gateway_account": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"upi_intent_link": "<string>",
"payment_link": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"enabled_payment_options": [],
"gateway_fields": {}
},
"phone_number_id": "<string>",
"reference_id": "<string>",
"footer": "<string>",
"header_image_url": "<string>",
"catalog_id": "<string>",
"expires_in_minutes": 21602,
"expiry_description": "<string>",
"importer": {
"name": "<string>",
"country_of_origin": "<string>",
"address": {
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"zone_code": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
}
},
"beneficiary": {
"name": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
},
"tax": {
"amount": 123,
"description": "<string>"
},
"shipping": {
"amount": 123,
"description": "<string>"
},
"discount": {
"amount": 123,
"description": "<string>",
"program_name": "<string>"
},
"template": {
"name": "<string>",
"language": "<string>",
"button_index": 123,
"components": [{}]
},
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '+919812345670',
body: JSON.stringify('<string>'),
items: [
{
name: '<string>',
amount: 2,
quantity: 5000,
sale_amount: 2,
retailer_id: '<string>',
image_url: '<string>',
country_of_origin: '<string>',
importer_name: '<string>',
importer_address: {}
}
],
payment: {
configuration: '<string>',
gateway_account: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
upi_intent_link: '<string>',
payment_link: '<string>',
success_url: '<string>',
cancel_url: '<string>',
enabled_payment_options: [],
gateway_fields: {}
},
phone_number_id: '<string>',
reference_id: '<string>',
footer: '<string>',
header_image_url: '<string>',
catalog_id: '<string>',
expires_in_minutes: 21602,
expiry_description: '<string>',
importer: {
name: '<string>',
country_of_origin: '<string>',
address: {
address_line1: '<string>',
address_line2: '<string>',
city: '<string>',
zone_code: '<string>',
postal_code: '<string>',
country_code: '<string>'
}
},
beneficiary: {
name: '<string>',
address_line1: '<string>',
address_line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>'
},
tax: {amount: 123, description: '<string>'},
shipping: {amount: 123, description: '<string>'},
discount: {amount: 123, description: '<string>', program_name: '<string>'},
template: {name: '<string>', language: '<string>', button_index: 123, components: [{}]},
metadata: {}
})
};
fetch('https://lazyapp.in/v1/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://lazyapp.in/v1/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '+919812345670',
'body' => '<string>',
'items' => [
[
'name' => '<string>',
'amount' => 2,
'quantity' => 5000,
'sale_amount' => 2,
'retailer_id' => '<string>',
'image_url' => '<string>',
'country_of_origin' => '<string>',
'importer_name' => '<string>',
'importer_address' => [
]
]
],
'payment' => [
'configuration' => '<string>',
'gateway_account' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'upi_intent_link' => '<string>',
'payment_link' => '<string>',
'success_url' => '<string>',
'cancel_url' => '<string>',
'enabled_payment_options' => [
],
'gateway_fields' => [
]
],
'phone_number_id' => '<string>',
'reference_id' => '<string>',
'footer' => '<string>',
'header_image_url' => '<string>',
'catalog_id' => '<string>',
'expires_in_minutes' => 21602,
'expiry_description' => '<string>',
'importer' => [
'name' => '<string>',
'country_of_origin' => '<string>',
'address' => [
'address_line1' => '<string>',
'address_line2' => '<string>',
'city' => '<string>',
'zone_code' => '<string>',
'postal_code' => '<string>',
'country_code' => '<string>'
]
],
'beneficiary' => [
'name' => '<string>',
'address_line1' => '<string>',
'address_line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>'
],
'tax' => [
'amount' => 123,
'description' => '<string>'
],
'shipping' => [
'amount' => 123,
'description' => '<string>'
],
'discount' => [
'amount' => 123,
'description' => '<string>',
'program_name' => '<string>'
],
'template' => [
'name' => '<string>',
'language' => '<string>',
'button_index' => 123,
'components' => [
[
]
]
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lazyapp.in/v1/payments"
payload := strings.NewReader("{\n \"to\": \"+919812345670\",\n \"body\": \"<string>\",\n \"items\": [\n {\n \"name\": \"<string>\",\n \"amount\": 2,\n \"quantity\": 5000,\n \"sale_amount\": 2,\n \"retailer_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"country_of_origin\": \"<string>\",\n \"importer_name\": \"<string>\",\n \"importer_address\": {}\n }\n ],\n \"payment\": {\n \"configuration\": \"<string>\",\n \"gateway_account\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"upi_intent_link\": \"<string>\",\n \"payment_link\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"enabled_payment_options\": [],\n \"gateway_fields\": {}\n },\n \"phone_number_id\": \"<string>\",\n \"reference_id\": \"<string>\",\n \"footer\": \"<string>\",\n \"header_image_url\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"expires_in_minutes\": 21602,\n \"expiry_description\": \"<string>\",\n \"importer\": {\n \"name\": \"<string>\",\n \"country_of_origin\": \"<string>\",\n \"address\": {\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"zone_code\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country_code\": \"<string>\"\n }\n },\n \"beneficiary\": {\n \"name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 123,\n \"description\": \"<string>\"\n },\n \"shipping\": {\n \"amount\": 123,\n \"description\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 123,\n \"description\": \"<string>\",\n \"program_name\": \"<string>\"\n },\n \"template\": {\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"button_index\": 123,\n \"components\": [\n {}\n ]\n },\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://lazyapp.in/v1/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"+919812345670\",\n \"body\": \"<string>\",\n \"items\": [\n {\n \"name\": \"<string>\",\n \"amount\": 2,\n \"quantity\": 5000,\n \"sale_amount\": 2,\n \"retailer_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"country_of_origin\": \"<string>\",\n \"importer_name\": \"<string>\",\n \"importer_address\": {}\n }\n ],\n \"payment\": {\n \"configuration\": \"<string>\",\n \"gateway_account\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"upi_intent_link\": \"<string>\",\n \"payment_link\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"enabled_payment_options\": [],\n \"gateway_fields\": {}\n },\n \"phone_number_id\": \"<string>\",\n \"reference_id\": \"<string>\",\n \"footer\": \"<string>\",\n \"header_image_url\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"expires_in_minutes\": 21602,\n \"expiry_description\": \"<string>\",\n \"importer\": {\n \"name\": \"<string>\",\n \"country_of_origin\": \"<string>\",\n \"address\": {\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"zone_code\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country_code\": \"<string>\"\n }\n },\n \"beneficiary\": {\n \"name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 123,\n \"description\": \"<string>\"\n },\n \"shipping\": {\n \"amount\": 123,\n \"description\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 123,\n \"description\": \"<string>\",\n \"program_name\": \"<string>\"\n },\n \"template\": {\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"button_index\": 123,\n \"components\": [\n {}\n ]\n },\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"+919812345670\",\n \"body\": \"<string>\",\n \"items\": [\n {\n \"name\": \"<string>\",\n \"amount\": 2,\n \"quantity\": 5000,\n \"sale_amount\": 2,\n \"retailer_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"country_of_origin\": \"<string>\",\n \"importer_name\": \"<string>\",\n \"importer_address\": {}\n }\n ],\n \"payment\": {\n \"configuration\": \"<string>\",\n \"gateway_account\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"upi_intent_link\": \"<string>\",\n \"payment_link\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"enabled_payment_options\": [],\n \"gateway_fields\": {}\n },\n \"phone_number_id\": \"<string>\",\n \"reference_id\": \"<string>\",\n \"footer\": \"<string>\",\n \"header_image_url\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"expires_in_minutes\": 21602,\n \"expiry_description\": \"<string>\",\n \"importer\": {\n \"name\": \"<string>\",\n \"country_of_origin\": \"<string>\",\n \"address\": {\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"zone_code\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country_code\": \"<string>\"\n }\n },\n \"beneficiary\": {\n \"name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 123,\n \"description\": \"<string>\"\n },\n \"shipping\": {\n \"amount\": 123,\n \"description\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 123,\n \"description\": \"<string>\",\n \"program_name\": \"<string>\"\n },\n \"template\": {\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"button_index\": 123,\n \"components\": [\n {}\n ]\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference_id": "<string>",
"to": "<string>",
"status": "pending",
"status_label": "<string>",
"payment_status": "pending",
"payment_status_label": "<string>",
"payment_method": "payment_gateway",
"gateway": "<string>",
"payment_configuration": "<string>",
"payment_link": "<string>",
"currency": "INR",
"total_amount": 123,
"amount_paid": 123,
"amount_refunded": 123,
"paid_with": "<string>",
"goods_type": "<string>",
"order": {},
"transactions": [
{}
],
"refunds": [
{}
],
"last_error": "<string>",
"message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number_id": "<string>",
"metadata": {},
"expires_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "provider_134011",
"retryable": true
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "provider_134011",
"retryable": true
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "provider_134011",
"retryable": true
}Payments
Send a payment request
Send an order details message with a Review and pay button. Amounts are paise. See the payments guide.
Required scope: messages:send
POST
/
v1
/
payments
Send a payment request
curl --request POST \
--url https://lazyapp.in/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "+919812345670",
"body": "<string>",
"items": [
{
"name": "<string>",
"amount": 2,
"quantity": 5000,
"sale_amount": 2,
"retailer_id": "<string>",
"image_url": "<string>",
"country_of_origin": "<string>",
"importer_name": "<string>",
"importer_address": {}
}
],
"payment": {
"configuration": "<string>",
"gateway_account": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"upi_intent_link": "<string>",
"payment_link": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"enabled_payment_options": [],
"gateway_fields": {}
},
"phone_number_id": "<string>",
"reference_id": "<string>",
"footer": "<string>",
"header_image_url": "<string>",
"catalog_id": "<string>",
"expires_in_minutes": 21602,
"expiry_description": "<string>",
"importer": {
"name": "<string>",
"country_of_origin": "<string>",
"address": {
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"zone_code": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
}
},
"beneficiary": {
"name": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
},
"tax": {
"amount": 123,
"description": "<string>"
},
"shipping": {
"amount": 123,
"description": "<string>"
},
"discount": {
"amount": 123,
"description": "<string>",
"program_name": "<string>"
},
"template": {
"name": "<string>",
"language": "<string>",
"button_index": 123,
"components": [
{}
]
},
"metadata": {}
}
'import requests
url = "https://lazyapp.in/v1/payments"
payload = {
"to": "+919812345670",
"body": "<string>",
"items": [
{
"name": "<string>",
"amount": 2,
"quantity": 5000,
"sale_amount": 2,
"retailer_id": "<string>",
"image_url": "<string>",
"country_of_origin": "<string>",
"importer_name": "<string>",
"importer_address": {}
}
],
"payment": {
"configuration": "<string>",
"gateway_account": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"upi_intent_link": "<string>",
"payment_link": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"enabled_payment_options": [],
"gateway_fields": {}
},
"phone_number_id": "<string>",
"reference_id": "<string>",
"footer": "<string>",
"header_image_url": "<string>",
"catalog_id": "<string>",
"expires_in_minutes": 21602,
"expiry_description": "<string>",
"importer": {
"name": "<string>",
"country_of_origin": "<string>",
"address": {
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"zone_code": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
}
},
"beneficiary": {
"name": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>"
},
"tax": {
"amount": 123,
"description": "<string>"
},
"shipping": {
"amount": 123,
"description": "<string>"
},
"discount": {
"amount": 123,
"description": "<string>",
"program_name": "<string>"
},
"template": {
"name": "<string>",
"language": "<string>",
"button_index": 123,
"components": [{}]
},
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '+919812345670',
body: JSON.stringify('<string>'),
items: [
{
name: '<string>',
amount: 2,
quantity: 5000,
sale_amount: 2,
retailer_id: '<string>',
image_url: '<string>',
country_of_origin: '<string>',
importer_name: '<string>',
importer_address: {}
}
],
payment: {
configuration: '<string>',
gateway_account: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
upi_intent_link: '<string>',
payment_link: '<string>',
success_url: '<string>',
cancel_url: '<string>',
enabled_payment_options: [],
gateway_fields: {}
},
phone_number_id: '<string>',
reference_id: '<string>',
footer: '<string>',
header_image_url: '<string>',
catalog_id: '<string>',
expires_in_minutes: 21602,
expiry_description: '<string>',
importer: {
name: '<string>',
country_of_origin: '<string>',
address: {
address_line1: '<string>',
address_line2: '<string>',
city: '<string>',
zone_code: '<string>',
postal_code: '<string>',
country_code: '<string>'
}
},
beneficiary: {
name: '<string>',
address_line1: '<string>',
address_line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>'
},
tax: {amount: 123, description: '<string>'},
shipping: {amount: 123, description: '<string>'},
discount: {amount: 123, description: '<string>', program_name: '<string>'},
template: {name: '<string>', language: '<string>', button_index: 123, components: [{}]},
metadata: {}
})
};
fetch('https://lazyapp.in/v1/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://lazyapp.in/v1/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '+919812345670',
'body' => '<string>',
'items' => [
[
'name' => '<string>',
'amount' => 2,
'quantity' => 5000,
'sale_amount' => 2,
'retailer_id' => '<string>',
'image_url' => '<string>',
'country_of_origin' => '<string>',
'importer_name' => '<string>',
'importer_address' => [
]
]
],
'payment' => [
'configuration' => '<string>',
'gateway_account' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'upi_intent_link' => '<string>',
'payment_link' => '<string>',
'success_url' => '<string>',
'cancel_url' => '<string>',
'enabled_payment_options' => [
],
'gateway_fields' => [
]
],
'phone_number_id' => '<string>',
'reference_id' => '<string>',
'footer' => '<string>',
'header_image_url' => '<string>',
'catalog_id' => '<string>',
'expires_in_minutes' => 21602,
'expiry_description' => '<string>',
'importer' => [
'name' => '<string>',
'country_of_origin' => '<string>',
'address' => [
'address_line1' => '<string>',
'address_line2' => '<string>',
'city' => '<string>',
'zone_code' => '<string>',
'postal_code' => '<string>',
'country_code' => '<string>'
]
],
'beneficiary' => [
'name' => '<string>',
'address_line1' => '<string>',
'address_line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>'
],
'tax' => [
'amount' => 123,
'description' => '<string>'
],
'shipping' => [
'amount' => 123,
'description' => '<string>'
],
'discount' => [
'amount' => 123,
'description' => '<string>',
'program_name' => '<string>'
],
'template' => [
'name' => '<string>',
'language' => '<string>',
'button_index' => 123,
'components' => [
[
]
]
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lazyapp.in/v1/payments"
payload := strings.NewReader("{\n \"to\": \"+919812345670\",\n \"body\": \"<string>\",\n \"items\": [\n {\n \"name\": \"<string>\",\n \"amount\": 2,\n \"quantity\": 5000,\n \"sale_amount\": 2,\n \"retailer_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"country_of_origin\": \"<string>\",\n \"importer_name\": \"<string>\",\n \"importer_address\": {}\n }\n ],\n \"payment\": {\n \"configuration\": \"<string>\",\n \"gateway_account\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"upi_intent_link\": \"<string>\",\n \"payment_link\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"enabled_payment_options\": [],\n \"gateway_fields\": {}\n },\n \"phone_number_id\": \"<string>\",\n \"reference_id\": \"<string>\",\n \"footer\": \"<string>\",\n \"header_image_url\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"expires_in_minutes\": 21602,\n \"expiry_description\": \"<string>\",\n \"importer\": {\n \"name\": \"<string>\",\n \"country_of_origin\": \"<string>\",\n \"address\": {\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"zone_code\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country_code\": \"<string>\"\n }\n },\n \"beneficiary\": {\n \"name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 123,\n \"description\": \"<string>\"\n },\n \"shipping\": {\n \"amount\": 123,\n \"description\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 123,\n \"description\": \"<string>\",\n \"program_name\": \"<string>\"\n },\n \"template\": {\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"button_index\": 123,\n \"components\": [\n {}\n ]\n },\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://lazyapp.in/v1/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"+919812345670\",\n \"body\": \"<string>\",\n \"items\": [\n {\n \"name\": \"<string>\",\n \"amount\": 2,\n \"quantity\": 5000,\n \"sale_amount\": 2,\n \"retailer_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"country_of_origin\": \"<string>\",\n \"importer_name\": \"<string>\",\n \"importer_address\": {}\n }\n ],\n \"payment\": {\n \"configuration\": \"<string>\",\n \"gateway_account\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"upi_intent_link\": \"<string>\",\n \"payment_link\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"enabled_payment_options\": [],\n \"gateway_fields\": {}\n },\n \"phone_number_id\": \"<string>\",\n \"reference_id\": \"<string>\",\n \"footer\": \"<string>\",\n \"header_image_url\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"expires_in_minutes\": 21602,\n \"expiry_description\": \"<string>\",\n \"importer\": {\n \"name\": \"<string>\",\n \"country_of_origin\": \"<string>\",\n \"address\": {\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"zone_code\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country_code\": \"<string>\"\n }\n },\n \"beneficiary\": {\n \"name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 123,\n \"description\": \"<string>\"\n },\n \"shipping\": {\n \"amount\": 123,\n \"description\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 123,\n \"description\": \"<string>\",\n \"program_name\": \"<string>\"\n },\n \"template\": {\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"button_index\": 123,\n \"components\": [\n {}\n ]\n },\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"+919812345670\",\n \"body\": \"<string>\",\n \"items\": [\n {\n \"name\": \"<string>\",\n \"amount\": 2,\n \"quantity\": 5000,\n \"sale_amount\": 2,\n \"retailer_id\": \"<string>\",\n \"image_url\": \"<string>\",\n \"country_of_origin\": \"<string>\",\n \"importer_name\": \"<string>\",\n \"importer_address\": {}\n }\n ],\n \"payment\": {\n \"configuration\": \"<string>\",\n \"gateway_account\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"upi_intent_link\": \"<string>\",\n \"payment_link\": \"<string>\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"enabled_payment_options\": [],\n \"gateway_fields\": {}\n },\n \"phone_number_id\": \"<string>\",\n \"reference_id\": \"<string>\",\n \"footer\": \"<string>\",\n \"header_image_url\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"expires_in_minutes\": 21602,\n \"expiry_description\": \"<string>\",\n \"importer\": {\n \"name\": \"<string>\",\n \"country_of_origin\": \"<string>\",\n \"address\": {\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"zone_code\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country_code\": \"<string>\"\n }\n },\n \"beneficiary\": {\n \"name\": \"<string>\",\n \"address_line1\": \"<string>\",\n \"address_line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 123,\n \"description\": \"<string>\"\n },\n \"shipping\": {\n \"amount\": 123,\n \"description\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 123,\n \"description\": \"<string>\",\n \"program_name\": \"<string>\"\n },\n \"template\": {\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"button_index\": 123,\n \"components\": [\n {}\n ]\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reference_id": "<string>",
"to": "<string>",
"status": "pending",
"status_label": "<string>",
"payment_status": "pending",
"payment_status_label": "<string>",
"payment_method": "payment_gateway",
"gateway": "<string>",
"payment_configuration": "<string>",
"payment_link": "<string>",
"currency": "INR",
"total_amount": 123,
"amount_paid": 123,
"amount_refunded": 123,
"paid_with": "<string>",
"goods_type": "<string>",
"order": {},
"transactions": [
{}
],
"refunds": [
{}
],
"last_error": "<string>",
"message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number_id": "<string>",
"metadata": {},
"expires_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "provider_134011",
"retryable": true
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "provider_134011",
"retryable": true
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "provider_134011",
"retryable": true
}Authorizations
Your API key, e.g. sk_live_... or sk_test_....
Headers
Optional. Makes this write safe to retry: the same key replays the first response instead of acting twice.
Maximum string length:
255Body
application/json
Example:
"+919812345670"
Maximum string length:
1024Required array length:
1 - 999 elementsShow child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum string length:
35Pattern:
^[A-Za-z0-9_.\-]+$Maximum string length:
60Available options:
digital-goods, physical-goods Required range:
5 <= x <= 43200Maximum string length:
120Required by WhatsApp for physical goods that are not from a catalog.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Send as a template, to reach contacts outside the 24-hour window.
Show child attributes
Show child attributes
Response
The payment.
Available options:
pending, processing, partially_shipped, shipped, completed, canceled Available options:
pending, captured, failed, partially_refunded, refunded Available options:
payment_gateway, upi_intent_link, payment_link Example:
"INR"
Paise.
Paise.
Paise.
How the contact paid, e.g. upi.
The items and totals as sent to WhatsApp.