Skip to main content
POST
/
v1
/
payment
Record payment
curl --request POST \
  --url https://app.getswipe.in/api/partner/v1/payment \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 27,
  "payment_date": "13-06-2024",
  "payment_mode": "UPI",
  "customer": "CUST123",
  "notes": "",
  "send_sms": true,
  "send_email": true,
  "exclusive_notes": "",
  "documents": [
    {
      "amount_paying": 27,
      "hash_id": "SLascded"
    }
  ]
}
'
import requests

url = "https://app.getswipe.in/api/partner/v1/payment"

payload = {
"amount": 27,
"payment_date": "13-06-2024",
"payment_mode": "UPI",
"customer": "CUST123",
"notes": "",
"send_sms": True,
"send_email": True,
"exclusive_notes": "",
"documents": [
{
"amount_paying": 27,
"hash_id": "SLascded"
}
]
}
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({
amount: 27,
payment_date: '13-06-2024',
payment_mode: 'UPI',
customer: 'CUST123',
notes: '',
send_sms: true,
send_email: true,
exclusive_notes: '',
documents: [{amount_paying: 27, hash_id: 'SLascded'}]
})
};

fetch('https://app.getswipe.in/api/partner/v1/payment', 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://app.getswipe.in/api/partner/v1/payment",
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([
'amount' => 27,
'payment_date' => '13-06-2024',
'payment_mode' => 'UPI',
'customer' => 'CUST123',
'notes' => '',
'send_sms' => true,
'send_email' => true,
'exclusive_notes' => '',
'documents' => [
[
'amount_paying' => 27,
'hash_id' => 'SLascded'
]
]
]),
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://app.getswipe.in/api/partner/v1/payment"

payload := strings.NewReader("{\n \"amount\": 27,\n \"payment_date\": \"13-06-2024\",\n \"payment_mode\": \"UPI\",\n \"customer\": \"CUST123\",\n \"notes\": \"\",\n \"send_sms\": true,\n \"send_email\": true,\n \"exclusive_notes\": \"\",\n \"documents\": [\n {\n \"amount_paying\": 27,\n \"hash_id\": \"SLascded\"\n }\n ]\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://app.getswipe.in/api/partner/v1/payment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 27,\n \"payment_date\": \"13-06-2024\",\n \"payment_mode\": \"UPI\",\n \"customer\": \"CUST123\",\n \"notes\": \"\",\n \"send_sms\": true,\n \"send_email\": true,\n \"exclusive_notes\": \"\",\n \"documents\": [\n {\n \"amount_paying\": 27,\n \"hash_id\": \"SLascded\"\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.getswipe.in/api/partner/v1/payment")

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 \"amount\": 27,\n \"payment_date\": \"13-06-2024\",\n \"payment_mode\": \"UPI\",\n \"customer\": \"CUST123\",\n \"notes\": \"\",\n \"send_sms\": true,\n \"send_email\": true,\n \"exclusive_notes\": \"\",\n \"documents\": [\n {\n \"amount_paying\": 27,\n \"hash_id\": \"SLascded\"\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "message": "Payment Recorded successfully"
}
{
"success": false,
"message": "Error Message",
"error_code": "HASH_ID_MISSING",
"errors": {
"customer_id": "Invalid ID."
}
}
{
"success": false,
"message": "Error Message",
"error_code": "HASH_ID_MISSING",
"errors": {
"customer_id": "Invalid ID."
}
}
{
"success": false,
"message": "Error Message",
"error_code": "HASH_ID_MISSING",
"errors": {
"customer_id": "Invalid ID."
}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer , where is your auth token.

Body

application/json
amount
number
required

Amount to be paid

Example:

27

payment_date
string
required

Payment date [DD-MM-YYYY]

Example:

"13-06-2024"

payment_mode
enum<string>
required

Payment mode

Available options:
Cash,
Cheque,
UPI,
Card,
Net Banking,
paylater,
cardless_emi,
EMI,
TDS,
Credits
Example:

"UPI"

customer
string
required

Customer ID

Example:

"CUST123"

bank_details
object
notes
string

Notes, will be shared with the customer

Example:

""

send_sms
boolean

Send SMS, customer will be notified through SMS

Example:

true

send_email
boolean

Send Email, customer will be notified through Email

Example:

true

exclusive_notes
string

Exclusive Notes for internal purpose

Example:

""

documents
object[]

Documents to be settled, if any

Example:
[
{
"amount_paying": 27,
"hash_id": "SLascded"
}
]

Response

Payment recorded successfully

success
boolean

Success flag

Example:

true

message
string

Response message

Example:

"Payment Recorded successfully"