Process duty payment for a collection
curl --request POST \
--url https://api.teleship.com/api/taxes-collections/{id}/payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"paymentMethodId": "pm_1234567890",
"email": "customer@example.com",
"name": "<string>",
"idempotencyKey": "<string>"
}
'import requests
url = "https://api.teleship.com/api/taxes-collections/{id}/payment"
payload = {
"paymentMethodId": "pm_1234567890",
"email": "customer@example.com",
"name": "<string>",
"idempotencyKey": "<string>"
}
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({
paymentMethodId: 'pm_1234567890',
email: 'customer@example.com',
name: '<string>',
idempotencyKey: '<string>'
})
};
fetch('https://api.teleship.com/api/taxes-collections/{id}/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://api.teleship.com/api/taxes-collections/{id}/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([
'paymentMethodId' => 'pm_1234567890',
'email' => 'customer@example.com',
'name' => '<string>',
'idempotencyKey' => '<string>'
]),
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://api.teleship.com/api/taxes-collections/{id}/payment"
payload := strings.NewReader("{\n \"paymentMethodId\": \"pm_1234567890\",\n \"email\": \"customer@example.com\",\n \"name\": \"<string>\",\n \"idempotencyKey\": \"<string>\"\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://api.teleship.com/api/taxes-collections/{id}/payment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"paymentMethodId\": \"pm_1234567890\",\n \"email\": \"customer@example.com\",\n \"name\": \"<string>\",\n \"idempotencyKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.teleship.com/api/taxes-collections/{id}/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 \"paymentMethodId\": \"pm_1234567890\",\n \"email\": \"customer@example.com\",\n \"name\": \"<string>\",\n \"idempotencyKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"messages": [
{
"code": 123,
"level": "error",
"timestamp": "2024-01-01T00:00:00.00Z",
"message": "An error occurred",
"details": [
"Missing required field"
]
}
],
"success": true,
"status": "succeeded",
"amount": 123,
"currency": "<string>",
"paymentIntentId": "<string>",
"alreadyPaid": true,
"error": "<string>",
"clientSecret": "<string>",
"requiresAction": true
}{
"messages": [
{
"code": 123,
"level": "error",
"timestamp": "2024-01-01T00:00:00.00Z",
"message": "An error occurred",
"details": [
"Missing required field"
]
}
]
}{
"messages": [
{
"code": 123,
"level": "error",
"timestamp": "2024-01-01T00:00:00.00Z",
"message": "An error occurred",
"details": [
"Missing required field"
]
}
]
}Taxes collections
Process duty payment for a collection
Process the duty payment for a taxes collection using Stripe.
POST
/
api
/
taxes-collections
/
{id}
/
payment
Process duty payment for a collection
curl --request POST \
--url https://api.teleship.com/api/taxes-collections/{id}/payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"paymentMethodId": "pm_1234567890",
"email": "customer@example.com",
"name": "<string>",
"idempotencyKey": "<string>"
}
'import requests
url = "https://api.teleship.com/api/taxes-collections/{id}/payment"
payload = {
"paymentMethodId": "pm_1234567890",
"email": "customer@example.com",
"name": "<string>",
"idempotencyKey": "<string>"
}
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({
paymentMethodId: 'pm_1234567890',
email: 'customer@example.com',
name: '<string>',
idempotencyKey: '<string>'
})
};
fetch('https://api.teleship.com/api/taxes-collections/{id}/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://api.teleship.com/api/taxes-collections/{id}/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([
'paymentMethodId' => 'pm_1234567890',
'email' => 'customer@example.com',
'name' => '<string>',
'idempotencyKey' => '<string>'
]),
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://api.teleship.com/api/taxes-collections/{id}/payment"
payload := strings.NewReader("{\n \"paymentMethodId\": \"pm_1234567890\",\n \"email\": \"customer@example.com\",\n \"name\": \"<string>\",\n \"idempotencyKey\": \"<string>\"\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://api.teleship.com/api/taxes-collections/{id}/payment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"paymentMethodId\": \"pm_1234567890\",\n \"email\": \"customer@example.com\",\n \"name\": \"<string>\",\n \"idempotencyKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.teleship.com/api/taxes-collections/{id}/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 \"paymentMethodId\": \"pm_1234567890\",\n \"email\": \"customer@example.com\",\n \"name\": \"<string>\",\n \"idempotencyKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"messages": [
{
"code": 123,
"level": "error",
"timestamp": "2024-01-01T00:00:00.00Z",
"message": "An error occurred",
"details": [
"Missing required field"
]
}
],
"success": true,
"status": "succeeded",
"amount": 123,
"currency": "<string>",
"paymentIntentId": "<string>",
"alreadyPaid": true,
"error": "<string>",
"clientSecret": "<string>",
"requiresAction": true
}{
"messages": [
{
"code": 123,
"level": "error",
"timestamp": "2024-01-01T00:00:00.00Z",
"message": "An error occurred",
"details": [
"Missing required field"
]
}
]
}{
"messages": [
{
"code": 123,
"level": "error",
"timestamp": "2024-01-01T00:00:00.00Z",
"message": "An error occurred",
"details": [
"Missing required field"
]
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Response
Show child attributes
Show child attributes
Whether the payment was successful
Payment status
Example:
"succeeded"
Amount paid in cents
Currency of payment
Stripe payment intent ID
Whether the collection was already paid
Error message if payment failed
Stripe client secret for 3D Secure authentication
Whether payment requires additional action (3D Secure)
Was this page helpful?
⌘I