Upload Document
curl --request POST \
--url https://service-sandbox.tazapay.com/v3/document \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"type": "<string>",
"reference": "<string>",
"name": "<string>",
"description": "<string>",
"metadata": "<string>"
}
'import requests
url = "https://service-sandbox.tazapay.com/v3/document"
payload = {
"url": "<string>",
"type": "<string>",
"reference": "<string>",
"name": "<string>",
"description": "<string>",
"metadata": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
type: '<string>',
reference: '<string>',
name: '<string>',
description: '<string>',
metadata: '<string>'
})
};
fetch('https://service-sandbox.tazapay.com/v3/document', 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://service-sandbox.tazapay.com/v3/document",
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([
'url' => '<string>',
'type' => '<string>',
'reference' => '<string>',
'name' => '<string>',
'description' => '<string>',
'metadata' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://service-sandbox.tazapay.com/v3/document"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"reference\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://service-sandbox.tazapay.com/v3/document")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"reference\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service-sandbox.tazapay.com/v3/document")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"reference\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "",
"data": {
"created_at": "2023-09-13T10:22:12.711645400Z",
"description": "This is a sample document",
"id": "doc_ck0oql7oclf1aqlh4jdg",
"metadata": null,
"name": "Purchase proof",
"object": "document",
"reference": "esc_ck0og8noclf1aqlh4icg",
"type": "tracking_url",
"url": "https://drive.google.com/file/d/1q5kk5YKcCojdTYir-rONXjN7szuXE16m/view?usp=sharing"
}
}"{}"Document
Add Document to a Resource
This lets you attach a document to any Tazapay resource like payout, entity etc
POST
/
v3
/
document
Upload Document
curl --request POST \
--url https://service-sandbox.tazapay.com/v3/document \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"type": "<string>",
"reference": "<string>",
"name": "<string>",
"description": "<string>",
"metadata": "<string>"
}
'import requests
url = "https://service-sandbox.tazapay.com/v3/document"
payload = {
"url": "<string>",
"type": "<string>",
"reference": "<string>",
"name": "<string>",
"description": "<string>",
"metadata": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
type: '<string>',
reference: '<string>',
name: '<string>',
description: '<string>',
metadata: '<string>'
})
};
fetch('https://service-sandbox.tazapay.com/v3/document', 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://service-sandbox.tazapay.com/v3/document",
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([
'url' => '<string>',
'type' => '<string>',
'reference' => '<string>',
'name' => '<string>',
'description' => '<string>',
'metadata' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://service-sandbox.tazapay.com/v3/document"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"reference\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://service-sandbox.tazapay.com/v3/document")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"reference\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://service-sandbox.tazapay.com/v3/document")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"type\": \"<string>\",\n \"reference\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "",
"data": {
"created_at": "2023-09-13T10:22:12.711645400Z",
"description": "This is a sample document",
"id": "doc_ck0oql7oclf1aqlh4jdg",
"metadata": null,
"name": "Purchase proof",
"object": "document",
"reference": "esc_ck0og8noclf1aqlh4icg",
"type": "tracking_url",
"url": "https://drive.google.com/file/d/1q5kk5YKcCojdTYir-rONXjN7szuXE16m/view?usp=sharing"
}
}"{}"Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
application/json
Dynamically downloadable URL for document OR Shipment tracking URL
Type of document uploaded. for example - delivery_proof, invoice etc. If you are uploading a document against a particular document request, please make sure the document name matches to the exact document requested.
ID of the object for which the document is being submitted (checkout, escrow, payin)
Name of the type in case the type is 'other'
Additional information about the document uploaded
Set of key-value pairs to attach to the document
Was this page helpful?
⌘I
