The “Order Fulfillment” API facilitates the process of fulfilling an order.
POST https://services.leadconnectorhq.com/payments/orders/{orderId}/fulfillments
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.
Path parameters
orderId
string
default:"653f5e0cde5a1314e62a837c"
required
ID of the order that needs to be returned
Body
altId
string
default:"6578278e879ad2646715ba9c"
required
Account Id or Agency Id
Posibles valores: ‘account’
Fulfillment tracking information
trackingNumber
string
default:"40012345678"
Tracking number provided by the shipping carrier
Fulfilled items
priceId
string
default:"6578278e879ad2646715ba9c"
required
The id of product price
qty
number
default:"1"
required
The no of quantity of the item
notifyCustomer
boolean
default:"True"
required
Need to send a notification to customer
Respuestas
200 - Successful response
status
boolean
default:"True"
required
Status of api action
422 - Unprocessable Entity
Ejemplo
curl -X POST 'https://services.leadconnectorhq.com/payments/orders/YOUR_orderId/fulfillments' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"trackings": [
{
"trackingNumber": "40012345678",
"shippingCarrier": "FedEx",
"trackingUrl": "https://www.fedex.com/wtrk/track/?trknbr=40012345678"
}
],
"items": [
{
"priceId": "6578278e879ad2646715ba9c",
"qty": 1
}
],
"notifyCustomer": true
}'
const response = await fetch('https://services.leadconnectorhq.com/payments/orders/YOUR_orderId/fulfillments', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "trackings": [{"trackingNumber": "40012345678", "shippingCarrier": "FedEx", "trackingUrl": "https://www.fedex.com/wtrk/track/?trknbr=40012345678"}], "items": [{"priceId": "6578278e879ad2646715ba9c", "qty": 1}], "notifyCustomer": true}),
});
const data = await response.json();
import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/payments/orders/YOUR_orderId/fulfillments',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "trackings": [{"trackingNumber": "40012345678", "shippingCarrier": "FedEx", "trackingUrl": "https://www.fedex.com/wtrk/track/?trknbr=40012345678"}], "items": [{"priceId": "6578278e879ad2646715ba9c", "qty": 1}], "notifyCustomer": true},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/payments/orders/YOUR_orderId/fulfillments');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'account', 'trackings': [{'trackingNumber': '40012345678', 'shippingCarrier': 'FedEx', 'trackingUrl': 'https://www.fedex.com/wtrk/track/?trknbr=40012345678'}], 'items': [{'priceId': '6578278e879ad2646715ba9c', 'qty': 1}], 'notifyCustomer': true}),
]);
$data = json_decode(curl_exec($ch), true);