Modifier une condition de paiement
curl --request PUT \
--url https://qwoty.app/api/payment-terms/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"api_name": "<string>",
"reference": "<string>",
"is_active": true,
"id_crm": "<string>",
"id_erp": "<string>",
"id_accounting": "<string>",
"installments": [
{
"name": "<string>",
"percentage": 123,
"term": {},
"custom_text": "<string>",
"order_number": 123
}
]
}
'import requests
url = "https://qwoty.app/api/payment-terms/{id}"
payload = {
"name": "<string>",
"api_name": "<string>",
"reference": "<string>",
"is_active": True,
"id_crm": "<string>",
"id_erp": "<string>",
"id_accounting": "<string>",
"installments": [
{
"name": "<string>",
"percentage": 123,
"term": {},
"custom_text": "<string>",
"order_number": 123
}
]
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
api_name: '<string>',
reference: '<string>',
is_active: true,
id_crm: '<string>',
id_erp: '<string>',
id_accounting: '<string>',
installments: [
{
name: '<string>',
percentage: 123,
term: {},
custom_text: '<string>',
order_number: 123
}
]
})
};
fetch('https://qwoty.app/api/payment-terms/{id}', 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://qwoty.app/api/payment-terms/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'api_name' => '<string>',
'reference' => '<string>',
'is_active' => true,
'id_crm' => '<string>',
'id_erp' => '<string>',
'id_accounting' => '<string>',
'installments' => [
[
'name' => '<string>',
'percentage' => 123,
'term' => [
],
'custom_text' => '<string>',
'order_number' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://qwoty.app/api/payment-terms/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"api_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"is_active\": true,\n \"id_crm\": \"<string>\",\n \"id_erp\": \"<string>\",\n \"id_accounting\": \"<string>\",\n \"installments\": [\n {\n \"name\": \"<string>\",\n \"percentage\": 123,\n \"term\": {},\n \"custom_text\": \"<string>\",\n \"order_number\": 123\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.put("https://qwoty.app/api/payment-terms/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"api_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"is_active\": true,\n \"id_crm\": \"<string>\",\n \"id_erp\": \"<string>\",\n \"id_accounting\": \"<string>\",\n \"installments\": [\n {\n \"name\": \"<string>\",\n \"percentage\": 123,\n \"term\": {},\n \"custom_text\": \"<string>\",\n \"order_number\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/payment-terms/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"api_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"is_active\": true,\n \"id_crm\": \"<string>\",\n \"id_erp\": \"<string>\",\n \"id_accounting\": \"<string>\",\n \"installments\": [\n {\n \"name\": \"<string>\",\n \"percentage\": 123,\n \"term\": {},\n \"custom_text\": \"<string>\",\n \"order_number\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Net 30 Days (Updated)",
"api_name": "net_30_days",
"reference": "PT001",
"is_active": true,
"id_crm": "crm_123",
"id_erp": "erp_456",
"id_accounting": "acc_789",
"installments": [
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"name": "Full Payment",
"percentage": 100,
"term": "net30",
"custom_text": null,
"order_number": 1
}
],
"created_at": "2024-12-21T10:30:00Z",
"updated_at": "2024-12-21T14:45:00Z"
}
}
Conditions de paiement
Modifier une condition de paiement
Modifier une condition de paiement existante
PUT
/
api
/
payment-terms
/
{id}
Modifier une condition de paiement
curl --request PUT \
--url https://qwoty.app/api/payment-terms/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"api_name": "<string>",
"reference": "<string>",
"is_active": true,
"id_crm": "<string>",
"id_erp": "<string>",
"id_accounting": "<string>",
"installments": [
{
"name": "<string>",
"percentage": 123,
"term": {},
"custom_text": "<string>",
"order_number": 123
}
]
}
'import requests
url = "https://qwoty.app/api/payment-terms/{id}"
payload = {
"name": "<string>",
"api_name": "<string>",
"reference": "<string>",
"is_active": True,
"id_crm": "<string>",
"id_erp": "<string>",
"id_accounting": "<string>",
"installments": [
{
"name": "<string>",
"percentage": 123,
"term": {},
"custom_text": "<string>",
"order_number": 123
}
]
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
api_name: '<string>',
reference: '<string>',
is_active: true,
id_crm: '<string>',
id_erp: '<string>',
id_accounting: '<string>',
installments: [
{
name: '<string>',
percentage: 123,
term: {},
custom_text: '<string>',
order_number: 123
}
]
})
};
fetch('https://qwoty.app/api/payment-terms/{id}', 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://qwoty.app/api/payment-terms/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'api_name' => '<string>',
'reference' => '<string>',
'is_active' => true,
'id_crm' => '<string>',
'id_erp' => '<string>',
'id_accounting' => '<string>',
'installments' => [
[
'name' => '<string>',
'percentage' => 123,
'term' => [
],
'custom_text' => '<string>',
'order_number' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://qwoty.app/api/payment-terms/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"api_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"is_active\": true,\n \"id_crm\": \"<string>\",\n \"id_erp\": \"<string>\",\n \"id_accounting\": \"<string>\",\n \"installments\": [\n {\n \"name\": \"<string>\",\n \"percentage\": 123,\n \"term\": {},\n \"custom_text\": \"<string>\",\n \"order_number\": 123\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.put("https://qwoty.app/api/payment-terms/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"api_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"is_active\": true,\n \"id_crm\": \"<string>\",\n \"id_erp\": \"<string>\",\n \"id_accounting\": \"<string>\",\n \"installments\": [\n {\n \"name\": \"<string>\",\n \"percentage\": 123,\n \"term\": {},\n \"custom_text\": \"<string>\",\n \"order_number\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qwoty.app/api/payment-terms/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"api_name\": \"<string>\",\n \"reference\": \"<string>\",\n \"is_active\": true,\n \"id_crm\": \"<string>\",\n \"id_erp\": \"<string>\",\n \"id_accounting\": \"<string>\",\n \"installments\": [\n {\n \"name\": \"<string>\",\n \"percentage\": 123,\n \"term\": {},\n \"custom_text\": \"<string>\",\n \"order_number\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Net 30 Days (Updated)",
"api_name": "net_30_days",
"reference": "PT001",
"is_active": true,
"id_crm": "crm_123",
"id_erp": "erp_456",
"id_accounting": "acc_789",
"installments": [
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"name": "Full Payment",
"percentage": 100,
"term": "net30",
"custom_text": null,
"order_number": 1
}
],
"created_at": "2024-12-21T10:30:00Z",
"updated_at": "2024-12-21T14:45:00Z"
}
}
Autorisation
string
requis
Jeton Bearer pour l’authentification. Format :
Bearer qwoty_your_tokenParamètres de chemin
string
requis
UUID de la condition de paiement à modifier
Corps de la requête
string
Nom de la condition de paiement (50 caractères max)
string
Identifiant API unique (format slug)
string
Code de référence interne (50 caractères max)
boolean
Indique si la condition de paiement est active
string
Identifiant CRM externe
string
Identifiant ERP externe
string
Identifiant du système comptable externe
array
Tableau des échéances de paiement. Si renseigné, remplace toutes les échéances existantes.
Vous pouvez modifier des champs individuels ou l’intégralité de la condition de paiement. Les champs omis
restent inchangés.
En cas de modification des échéances, la somme de tous les pourcentages doit être égale à 100 %.
Exemples
curl -X PUT https://qwoty.app/api/payment-terms/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer qwoty_your_token" \
-H "Content-Type: application/json" \
-d '{
"name": "Net 30 Days (Updated)"
}'
curl -X PUT https://qwoty.app/api/payment-terms/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer qwoty_your_token" \
-H "Content-Type: application/json" \
-d '{
"is_active": false
}'
curl -X PUT https://qwoty.app/api/payment-terms/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer qwoty_your_token" \
-H "Content-Type: application/json" \
-d '{
"name": "50% Deposit + 50% Net 30",
"api_name": "50_deposit_50_net30",
"installments": [
{
"name": "Deposit",
"percentage": 50,
"term": "due_now",
"order_number": 1
},
{
"name": "Balance",
"percentage": 50,
"term": "net30",
"order_number": 2
}
]
}'
const paymentTermId = '550e8400-e29b-41d4-a716-446655440000'
const response = await fetch(
`https://qwoty.app/api/payment-terms/${paymentTermId}`,
{
method: 'PUT',
headers: {
Authorization: 'Bearer qwoty_your_token',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Net 30 Days (Updated)',
is_active: true,
}),
},
)
const data = await response.json()
import requests
payment_term_id = '550e8400-e29b-41d4-a716-446655440000'
response = requests.put(
f'https://qwoty.app/api/payment-terms/{payment_term_id}',
headers={
'Authorization': 'Bearer qwoty_your_token',
'Content-Type': 'application/json'
},
json={
'name': 'Net 30 Days (Updated)',
'is_active': True
}
)
data = response.json()
Réponse
boolean
Indique si la requête a été traitée avec succès
object
L’objet condition de paiement mis à jour avec tous les champs
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Net 30 Days (Updated)",
"api_name": "net_30_days",
"reference": "PT001",
"is_active": true,
"id_crm": "crm_123",
"id_erp": "erp_456",
"id_accounting": "acc_789",
"installments": [
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"name": "Full Payment",
"percentage": 100,
"term": "net30",
"custom_text": null,
"order_number": 1
}
],
"created_at": "2024-12-21T10:30:00Z",
"updated_at": "2024-12-21T14:45:00Z"
}
}
Réponses d’erreur
{
"success": false,
"error": "Payment term not found"
}
{
"success": false,
"error": "Installment percentages must sum to 100%"
}
{
"success": false,
"error": "Payment term with api_name 'net_30_days' already exists"
}
{
"success": false,
"error": "Invalid API token"
}
Cette page vous a-t-elle été utile ?
⌘I

