Bienvenido a la API de PamBill. En esta página aprenderá a enviar datos de pedidos a PamBill. Con la API, puede crear fácilmente una aplicación para conectarse a PamBill e importar automáticamente datos de pedidos desde cualquier sistema externo.
La conexión se realiza mediante las claves de API, que encontrará en su cuenta de PamBill. Estas claves se generan por tienda para que pueda enviar datos de pedidos a una tienda específica, en caso de tener varias tiendas configuradas en PamBill. Nota: Se requiere un paquete Pro activo para usar la API; los demás paquetes no la incluyen.
No hay límites en cuanto al número de tiendas a las que puede enviar datos ni en la cantidad de pedidos que puede enviar a PamBill (aunque contamos con cierta protección contra inundaciones; consulte las limitaciones de la API para obtener más información).
Si tiene alguna pregunta sobre la API, póngase en contacto con nuestro soporte en: https://support.pambill.com/
La versión actual de la API es la 1.2.
Si necesita ayuda para crear una integración o desea solicitar una función o una extensión de la API, póngase en contacto con nuestro equipo de soporte técnico abriendo un ticket en https://support.pambill.com/.
Las claves API son específicas de cada tienda. Para encontrarlas, abra la página Tiendas en PamBill en https://www.pambill.com/shops-manage/ y haga clic en el nombre de la tienda para editarla. Desplácese hasta la sección Tokens de API y copie las claves.
La clave pública es el TOKEN de la solicitud de API.
La clave secreta se utiliza para calcular la suma de comprobación de la solicitud (CHECKSUM).
Todas las solicitudes deben enviarse a https://www.pambill.com/api
Solo se aceptan solicitudes HTTP POST. No envíe los datos como archivo adjunto. No utilice enctype="multipart/form-data". En su lugar, envíe solicitudes POST sin formato.
Cualquier herramienta o tecnología capaz de enviar solicitudes HTTP POST puede utilizarse como cliente; por ejemplo, una página web en un navegador. A continuación, se muestra un ejemplo práctico de cómo enviar una solicitud a la API de PamBill con jQuery. Si desea probarlo, configure sus propios valores de token, secret, origin y data.
<!-- Include jQuery and Crypto.js -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
<script type="text/javascript">
function sendDataToPamBill() {
const api_version = '1.2';
const action = 'import';
// the public shop token from PamBill
const token = 'UVxO25b0rAa11E8a9fAaBD02ZIMIvKc6';
// the secret shop token from PamBill
// NOTE: Never include secret tokens into a public page,
// as the page source can be viewed by anyone
const secret = 'k2FLfgLU3A68s36WVoa2RLcx3Kl5w2DM';
// the name of your app
const origin = 'ExporterBrandApp';
// an array of orders to be imported
// see the DATA section for sample data
const data = [{}];
// generate the CALL_ID
let call_id = Date.now().toString();
// add the random part to make CALL_ID exactly 32 chars long
let counter = call_id.length;
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
while (counter < 32) {
call_id += chars.charAt(Math.floor(Math.random() * chars.length));
counter += 1;
}
// calculate the checksum
let checksum = token + secret + call_id;
// hash the result
checksum = CryptoJS.SHA256(checksum).toString(CryptoJS.enc.Hex);
// send the request to PamBill API
let request = {
"VERSION": api_version,
"ORIGIN": origin,
"TOKEN": token,
"CALL_ID": call_id,
"ACTION": action,
"CHECKSUM": checksum,
"DATA": data
};
$.ajax({
type: "POST",
url: 'https://www.pambill.com/api',
data: JSON.stringify(request),
success: function(response) {
// console.log(response);
let responseObj = JSON.parse(response);
if (responseObj.STATE == "ERROR") {
// request rejected
console.log(responseObj.ERROR.CODE);
console.log(responseObj.ERROR.MESSAGE);
}
if (responseObj.STATE == "OK") {
// request accepted
if (responseObj.DATA.hasOwnProperty('SUCCESS')) {
console.log('Successfully imported orders: ' + JSON.stringify(responseObj.DATA.SUCCESS));
}
if (responseObj.DATA.hasOwnProperty('ERROR')) {
console.log('Import failed of orders: ' + JSON.stringify(responseObj.DATA.ERROR));
}
}
}
});
}
sendDataToPamBill();
</script>
Una forma sencilla y práctica de enviar solicitudes a la API es utilizando CURL. Por ejemplo:
curl -i -X POST -H 'Content-Type: application/json' -d '{REQUEST as JSON}' https://www.pambill.com/api
PamBill importa los pedidos a la tienda identificada por el campo TOKEN de la solicitud API. Si tiene más de una tienda en la cuenta de PamBill, utilice los tokens API correspondientes para cada tienda al enviar los datos a PamBill. Asignar pedidos a sus tiendas es necesario para que PamBill detecte pedidos duplicados.
A menos que envíe los pedidos desde la caja o desde la página de pedidos, combínelos en paquetes. El campo DATA acepta una matriz de entidades, y es mucho más eficiente enviar 100 pedidos en una sola solicitud que 100 solicitudes con un solo pedido cada una.
Como regla general, recomendamos enviar entre 50 y 100 pedidos a PamBill en una llamada API. Esto mejorará el rendimiento y reducirá el riesgo de tiempo de espera. El número máximo de pedidos permitidos en una solicitud API es de 500.
Cada solicitud debe incluir los siguientes campos con sus valores.
La versión de la API. La versión actual es «1.2».
Valores de ejemplo:
• 1.2
El nombre corto personalizado del sistema que envía los datos a PamBill. Utilice el mismo valor para todas las solicitudes de API. Este valor identificará su aplicación en PamBill.
La longitud permitida es de 3 a 32 caracteres. Caracteres permitidos: [0-9a-zA-Z_]. Los números solo se deben usar si forman parte del nombre de la aplicación, por ejemplo, 1signal, y NO deben representar la versión de la aplicación.
Si es posible, comience cada palabra significativa con mayúscula.
Valores de ejemplo:
• SuperExportApp
• Thinkific_Export_by_Anna
• EshopExporter
• WooCommerceOrders
Representa la tienda en PamBill. Este es el token público que se muestra en la página "Editar tienda" de PamBill y se genera automáticamente. El usuario de PamBill debe pasarlo al cliente API.
Debe tener exactamente 32 caracteres.
Valores de ejemplo:
• DF892KQY9A969g2o14I06uJDbAJk6aI8
Valor único para cada llamada a la API realizada para el token especificado. Se utiliza como nonce para evitar un ataque de repetición. Como sugerencia, puede ser una marca de tiempo (en milisegundos o microsegundos) concatenada con una cola alfanumérica aleatoria de exactamente 32 caracteres.
Tanto la marca de tiempo como la cola, o ambas, deben cambiar con cada llamada; por lo tanto, se recomienda no usar solo una marca de tiempo y una cola fija, ya que no se garantiza que el valor de la marca de tiempo cambie cuando las llamadas se envían rápidamente una tras otra.
Tenga en cuenta también que la longitud de la marca de tiempo puede cambiar con el tiempo, por lo que es recomendable construir la cadena y luego usar sus primeros 32 caracteres.
Debe tener exactamente 32 caracteres. Los caracteres permitidos son [0-9a-zA-Z_]
Valores de ejemplo:
• 1661240906651DF892KQY9A969g2o14e
• 1661240906651_DF892KQY9A969g2o14
• 1661240906651987_DF892KQY9A969g2
• 16612409066519874037492515795326
Se devuelve el siguiente error si la API ya ha registrado una solicitud con el mismo CALL_ID y TOKEN:
{"STATE":"ERROR","ERROR":{"CODE":"ERR_API_DUPLICATED_REQUEST","MESSAGE":"CALL_ID must be unique for each request"}}
El valor de este campo indica a PamBill el propósito de esta llamada.
El parámetro ACTION reemplaza los métodos HTTP POST, GET, PUT, PATCH y DELETE que se usan tradicionalmente en las API REST. En su lugar, solo aceptamos solicitudes POST al punto final de URL único, y la operación se define mediante la acción.
Por ejemplo, si el cliente de la API necesita obtener un enlace externo a una factura, debe enviar una solicitud POST con la ACTION correspondiente y obtener los datos de la respuesta.
Las solicitudes con una ACTION no compatible se rechazan. Las acciones de servicio, como validate_token, validate_account, pambill_package y latest_order_number, no requieren un Pro-Package activo.
A continuación, se muestra la lista de acciones compatibles actualmente.
ACTION | Description | DATA | Response example(s) |
---|---|---|---|
import |
Import orders from any online or offline store into PamBill. See the DATA section of this guide for the data format reference and sample order data. If the orders have been imported, a UUID is returned for each order, that can be used to reference the order in PamBill |
array of orders | {"STATE":"OK","DATA":{"SUCCESS":{"COUNT":1,"DATA":[{"order_number":1002,"uuid":"ZIe8CD3FMU1143zn"}]},"ERROR":{"COUNT":1,"DATA":[{"order_number":1001,"error":"ERR_INVOICE_ALREADY_EXISTS"}]}}} |
import_shopify |
Import orders from a Shopify store into PamBill. The orders are typically requested from the Shopify GraphQL Admin API, and sent to PamBill as is. To parse the order, PamBill uses fields like billingAddress, lineItems, shippingAddress and transactions, which means that you may need to request extra data from the GraphQL API. Please contact PamBill support for the exact list of required order fields and the supported versions of Shopify GraphQL API. If the orders have been imported, a UUID is returned for each order, that can be used to reference the order in PamBill |
array of orders | {"STATE":"OK","DATA":{"SUCCESS":{"COUNT":1,"DATA":[{"order_number":1002,"uuid":"ZIe8CD3FMU1143zn"}]},"ERROR":{"COUNT":1,"DATA":[{"order_number":1001,"error":"ERR_INVOICE_ALREADY_EXISTS"}]}}} |
validate_token |
Validate that both public and secret tokens are recognized by PamBill. The secret token is not included in the request, but is used when calculating the CHECKSUM. ERR_API_CHECKSUM_INCORRECT means that either the secret token is wrong, or you calculate the CHECKSUM incorrectly |
'' |
{"STATE":"OK","DATA":[]} {"STATE":"ERROR","ERROR":{"CODE":"ERR_API_CHECKSUM_INCORRECT","MESSAGE":""}} |
validate_account |
Validate that the PamBill account has an active Pro or Trial package. ERR_API_PRO_USERS_ONLY means that the user does not have the package, and orders cannot be imported at the moment. Please do not rely on the MESSAGE returned, as it may be changed or translated in the future |
'' |
{"STATE":"OK","DATA":[]} {"STATE":"ERROR","ERROR":{"CODE":"ERR_API_PRO_USERS_ONLY","MESSAGE":"An active Professional package is required to import orders into PamBill. To upgrade or convert your current package to Pro, please visit https://www.pambill.com/shop/extend/"}} |
pambill_package |
Returns the current PamBill package, or NONE if the PamBill account has no active package. The package renewal link is also returned. The package can have values NONE, PRO, BASIC, STARTER. PRO is also returned in case of the free trial at PamBill. The expiration_date is the number of seconds since the Unix epoch. expiration_date_formatted is formatted according to the PamBill account settings |
'' |
{"STATE":"OK","DATA":{"package":"NONE","expiration_date":"","expiration_date_formatted":"","renewal_link":"https://www.pambill.com/shop/extend/"}} {"STATE":"OK","DATA":{"package":"PRO","expiration_date":1703958918,"expiration_date_formatted":"30. December 2028","renewal_link":"https://www.pambill.com/shop/extend/"}} {"STATE":"OK","DATA":{"package":"STARTER","expiration_date":1703958918,"expiration_date_formatted":"30.12.2028","renewal_link":"https://www.pambill.com/shop/extend/"}} |
latest_order_number |
Returns the number of the latest order found in the given shop (identified by the TOKEN of the request) in PamBill. The orders are sorted by the date of the order, as the order number is not always sortable. Invoices that were manually created in PamBill, are ignored during this search. Empty order number is returned if no order is found in PamBill. latest_order_date is also returned, for reference |
'' |
{"STATE":"OK","DATA":{"latest_order_number":"","latest_order_date":""}} {"STATE":"OK","DATA":{"latest_order_number":"1000","latest_order_date":"2025-08-05 11:38:32"}} |
La suma de comprobación se utiliza para confirmar que la solicitud está autorizada. Este valor permite a PamBill validar que la solicitud se creó con el token secreto correcto.
La suma de comprobación debe calcularse para cada solicitud utilizando el token secreto que se encuentra en la página "Editar tienda" de PamBill. El usuario de PamBill debe pasar el token al cliente de la API. Tanto los tokens públicos como los secretos se encuentran en la página "Editar tienda" de PamBill.
La fórmula de cálculo es la siguiente:
CHECKSUM = sha256 ( TOKEN + Secret + CALL_ID )
Código PHP para calcular la suma de comprobación:
// calculate the CHECKSUM
// $token is the TOKEN of the request
// $secret is the secret API token that matches the TOKEN of the request
// $call_id is the CALL_ID of the request
$checksum = hash('sha256', $token . $secret . $call_id);
Código JavaScript para calcular la suma de comprobación:
// in this example, we use Crypto.js for easy hashing
// https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js
let checksum = token + secret + call_id;
// hash the result
checksum = CryptoJS.SHA256(checksum).toString(CryptoJS.enc.Hex);
Los datos, en formato JSON. Si la acción no requiere ningún dato, establezca DATA como una cadena vacía.
Si la acción es "import" o "import_shopify", esperamos que los DATA sean un array de pedidos.
Valor de ejemplo:
• [{_order1_},{_order2_}]
• ''
Los campos obligatorios de cada pedido si la ACTION es "import":
• order_number (número de pedido)
• order_date (fecha del pedido)
• currency (moneda)
• billing_address -> email (dirección de facturación -> correo electrónico)
• items (matriz de artículos con al menos un artículo)
Campos obligatorios de cada artículo:
• quantity (cantidad)
• price_gross (precio bruto)
• name (nombre)
Si el importe del pedido supera los 250 euros, la factura debe incluir el nombre completo y la dirección del cliente (destinatario del servicio). Es un requisito legal. El cliente se representa mediante la dirección de facturación (billing_address) de los datos del pedido.
[{
"//documentation0": "NOTE: These \"//documentation*\" properties are NOT used by the parser. Please remove them before deploying the API client and sending requests to PamBill API",
"//documentation1": "If you do not have the data, just do not include the value (set it to null or empty string) and see if the order can be imported. We use default values where possible",
"//documentation2": "Some values are mandatory: \"order_number\", \"billing_address\" with the \"email\", the \"items\" array, and more",
"//documentation3": "All the prices are expected to be gross, i.e. with VAT included.",
"//documentation4": "PamBill applies a set of VAT extraction rules at import to provide for correct VAT on the invoices, based on the Settings.",
"//documentation5": "We support OSS, EU VAT exemption, small traders, selling from EU to non-EU, using the reduced VAT rate, and more.",
"//documentation6": "Please review the VAT Settings at https://www.pambill.com/user/company/#vat_number",
"//documentation7": "We also provide the following fields/flags that can be used to control the VAT rate at import.",
"//documentation8": "\"apply_reduced_vat\": set to true for reduced-VAT products. The alternative is including the reduced-VAT code into the product name or variant. See the Reduced VAT settings at https://www.pambill.com/user/company/#vat_number",
"//documentation9": "\"apply_no_vat\": set to true for VAT-exempt products. The alternative is including the zero-VAT code into the product name or variant. See the Reduced VAT settings at https://www.pambill.com/user/company/#vat_number",
"//documentation10": "\"special_vat_rate\": e.g. \"7.7\". This field allows overriding the VAT rate at import and deprecates the advanced VAT extraction logic that PamBill would use otherwise.",
"//documentation11": "The typical usage of the \"special_vat_rate\" is for products that need to have special VAT rates, e.g. 3.7% instead of the standard 2.5% reduced VAT in Switzerland.",
"//documentation12": "\"order_number\": the format can be \"01001\", \"#1001\", \"#01001\", \"1001\"",
"//documentation13": "\"order_date\": we use the strtotime() PHP function to parse the date and time",
"//documentation14": "\"currency\": EUR, USD, CHF, etc.",
"//documentation15": "\"preferred_language\": an ISO language code, will be stored in the Customer in PamBill and later used in the invoices, e-mails, etc.",
"//documentation16": "\"prices_include_vat\": ALWAYS true. Send us the GROSS values only. PamBill will extract the VAT at import",
"order_number": "1001",
"order_date": "2025-08-05T11:00:00-05:00",
"currency": "USD",
"preferred_language": "en",
"prices_include_vat": true,
"payment": {
"//documentation0": "\"provider\": can be a string or an array. E.g. \"Credit Card\" or [\"PayPal\", \"Cash on Delivery (COD)\"]. See the supported payment types at https://www.pambill.com/user/company/ in the Payment and Shipping section, or supply your value and let us know in a support request",
"//documentation1": "\"paid_at\": if provided, the order will be set into the Paid state at import. The order will also become Paid if the \"provider\" is of a pre-paid type, e.g. Credit Card, PayPal, Direct Debit, etc.",
"//documentation2": "\"price_gross\": if provided, the order will be set into the Paid state at import. The order will also become Paid if the \"provider\" is of a pre-paid type, e.g. Credit Card, PayPal, Direct Debit, etc.",
"provider": "PayPal",
"paid_at": null,
"price_gross": null
},
"discount": {
"//documentation0": "\"code\": discount or voucher name",
"//documentation1": "\"price_gross\" can be positive or negative, PamBill will handle both as negative",
"price_gross": 10.0,
"code": "Gift Voucher"
},
"refund": {
"//documentation0": "This section covers both cancellation and refund. If the \"price_gross\" is null, it is a cancellation, otherwise a refund",
"//documentation1": "\"price_gross\": null in case of cancellation. Total gross amount of all refunds for this order. If the refunded amount is smaller than the total, it is a partial refund. It is possible to import the same order with increased refunded amount into PamBill a few times, to update the partially refunded amount in the invoice",
"//documentation2": "\"price_gross\" can be positive or negative, PamBill will handle both as negative",
"//documentation3": "\"cancelled_at\": cancellation or refund datetime",
"price_gross": 100.0,
"cancelled_at": null,
"reason": null
},
"billing_address": {
"//documentation0": "\"billing_address\" represents the Customer entity in PamBill. The \"email\" is mandatory",
"//documentation1": "\"company_vat\": if present and valid, the VAT number will be used for EU VAT exemption. Needs to match the billing country",
"//documentation2": "\"country_code\": ISO country code",
"//documentation3": "\"salutation\": Mr., Ms., Mrs, Señor, Señora, Herr, etc. or null",
"//documentation4": "\"first_name\": provide either \"name\", or \"first_name\" and \"last_name\", or all of them",
"//documentation5": "\"last_name\": provide either \"name\", or \"first_name\" and \"last_name\", or all of them",
"//documentation6": "\"name\": provide either \"name\", or \"first_name\" and \"last_name\", or all of them",
"//documentation7": "\"notes\": Billing Notes",
"//documentation8": "\"region\": if present, will be printed in the address",
"address1": "2259 Park Ct",
"address2": "Apartment 5",
"city": "Drayton Valley",
"company": "Gorski & Partners",
"company_vat": "DE250438265",
"country_code": "CA",
"email": "bob.norman@mail.example.com",
"salutation": "Mr.",
"first_name": "Christopher",
"last_name": "Gorski",
"name": "Christopher Gorski",
"notes": null,
"phone": "+13125551212",
"region": "Alberta",
"zip": "T0E 0M0"
},
"shipping_address": {
"//documentation0": "\"shipping_address\" may be empty, e.g. when no delivery is needed, or when it matches the \"billing_address\"",
"//documentation1": "\"notes\": Shipping Notes",
"address1": "123 Amoebobacterieae St",
"address2": "",
"city": "Ottawa",
"company": null,
"country_code": "CA",
"email": "bob.bobsen@mail.example.com",
"salutation": null,
"first_name": "Bob",
"last_name": "Bobsen",
"name": "Bob Bobsen",
"notes": null,
"phone": "555-625-1199",
"region": "Ontario",
"zip": "K2P0V6"
},
"items": [
{
"//documentation0": "\"price_gross\": gross price of one item",
"//documentation1": "The priority (descending): \"special_vat_rate\", \"apply_no_vat\", \"apply_reduced_vat\"",
"//documentation2": "\"special_vat_rate\": e.g. \"3.7\". This can be used to force the special VAT rate",
"//documentation3": "\"apply_no_vat\": set to true is this product is VAT-exempt",
"//documentation4": "\"apply_reduced_vat\": apply the reduced VAT rate at import to this item / product",
"quantity": 1,
"price_gross": "199.99",
"sku": "IPOD-342-N",
"name": "IPod Nano",
"variant": "Pink",
"apply_reduced_vat": false,
"apply_no_vat": false,
"special_vat_rate": null
},
{
"quantity": 2,
"price_gross": "15",
"sku": "CASE-01",
"name": "Universal Phone Case",
"variant": null,
"apply_reduced_vat": false,
"apply_no_vat": false,
"special_vat_rate": null
},
{
"quantity": 1,
"price_gross": "9.99",
"sku": null,
"name": "100% Arabica",
"variant": "500g",
"apply_reduced_vat": true,
"apply_no_vat": false,
"special_vat_rate": null
},
{
"quantity": 1,
"price_gross": "21.29",
"sku": null,
"name": "Bio Espresso Decaf",
"variant": "1000g",
"apply_reduced_vat": false,
"apply_no_vat": false,
"special_vat_rate": "3.7"
},
{
"quantity": 1,
"price_gross": "10.00",
"sku": null,
"name": "Something VAT-exempt",
"variant": null,
"apply_reduced_vat": false,
"apply_no_vat": true,
"special_vat_rate": null
}
],
"shipping": {
"//documentation0": "The delivery / post fee VAT rate is set in PamBill VAT Settings.",
"//documentation1": "In case the invoice items have reduced VAT, the delivery / post fee VAT will also be reduced.",
"delivery": {
"price_gross": "9.99",
"type": null
},
"post_fee": {
"price_gross": null,
"type": null
}
}
}]
Los siguientes límites se aplican a todas las solicitudes API para evitar el uso indebido y la sobrecarga.
El número total de solicitudes API enviadas a una tienda PamBill (el TOKEN) no puede superar las 1000 solicitudes cada 10 minutos. Se devuelve ERR_API_TOO_MANY_REQUESTS.
{"STATE":"ERROR","ERROR":{"CODE":"ERR_API_TOO_MANY_REQUESTS","MESSAGE":""}}
El tamaño de cada solicitud API codificada en JSON no puede superar los 64 Mb. La probabilidad de que se alcance este límite es muy baja debido a las demás restricciones, pero si ocurre, por favor, infórmenos. Se devuelve ERR_API_REQUEST_TOO_BIG.
{"STATE":"ERROR","ERROR":{"CODE":"ERR_API_REQUEST_TOO_BIG","MESSAGE":"65536kB max"}}
El número de entidades en el campo DATA de cualquier solicitud no puede superar las 500. Se devuelve ERR_API_TOO_MANY_DATA_ENTITIES. El número recomendado de entidades en DATA es de 50 a 100.
{"STATE":"ERROR","ERROR":{"CODE":"ERR_API_TOO_MANY_DATA_ENTITIES","MESSAGE":""}}
Estas son algunas de las respuestas que puede devolver la API de PamBill. Estos errores permiten gestionar fallos y permitir la interacción del usuario.
Tenga en cuenta que la respuesta DATA puede ser un objeto, una matriz de objetos o una matriz vacía, según la estructura de la respuesta, que a su vez depende del valor de ACTION de la solicitud.
El estado OK significa que el JSON de la solicitud se analizó, la solicitud pasó la validación, el TOKEN se reconoció, la ACTION se encontró, la CHECKSUM es correcta y los DATA se pudieron analizar.
Si algunos o todos los pedidos se rechazan por duplicado, el estado de la respuesta seguirá siendo OK.
Al importar un pedido, se devolverá el UUID en la respuesta. Guárdelo, ya que el UUID puede usarse para referenciar el pedido en PamBill.
Todos los pedidos se han importado correctamente. La respuesta incluye el UUID de cada pedido en PamBill.
{"STATE":"OK","DATA":{"SUCCESS":{"COUNT":2,"DATA":[{"order_number":1001,"uuid":"669b7d9Ga3p1ZF9F"},{"order_number":1002,"uuid":"4t2DD412EY8Cac9M"}]},"ERROR":{"COUNT":0,"DATA":[]}}}
Cuando se rechazan algunos o todos los pedidos, se enumeran en la sección ERROR del campo DATA de la respuesta.
{"STATE":"OK","DATA":{"SUCCESS":{"COUNT":1,"DATA":[{"order_number":1002,"uuid":"ZIe8CD3FMU1143zn"}]},"ERROR":{"COUNT":1,"DATA":[{"order_number":1001,"error":"ERR_INVOICE_ALREADY_EXISTS"}]}}}
El estado ERROR significa que la solicitud fue rechazada porque no se pudo analizar (JSON no válido), no superó la validación o la autorización, o alcanzó uno de los límites de la API. No confíes en el campo MESSAGE de la respuesta. Es opcional y puede modificarse, traducirse o eliminarse con el tiempo.
No se pudo importar un pedido. Esto suele significar que faltan algunos campos obligatorios del pedido o que tienen valores incorrectos.
Tenga en cuenta que todos los demás pedidos de la solicitud de API también se rechazan, ya que la solicitud se considera incorrecta.
{"STATE":"ERROR","ERROR":{"CODE":"ERR_API_INCORRECT_DATA_FORMAT","MESSAGE":"order_number cannot be empty"}}
A continuación se muestran más ejemplos de respuestas de la API en caso de error.
{"STATE":"ERROR","ERROR":{"CODE":"ERR_API_FAILED_TO_DECODE_JSON","MESSAGE":"Syntax error"}}
{"STATE":"ERROR","ERROR":{"CODE":"ERR_API_TOO_MANY_REQUESTS","MESSAGE":""}}
{"STATE":"ERROR","ERROR":{"CODE":"ERR_API_REQUEST_TOO_BIG","MESSAGE":"65536kB max"}}
{"STATE":"ERROR","ERROR":{"CODE":"ERR_API_TOO_MANY_DATA_ENTITIES","MESSAGE":""}}
{"STATE":"ERROR","ERROR":{"CODE":"ERR_API_DUPLICATED_REQUEST","MESSAGE":"CALL_ID must be unique for each request"}}
{"STATE":"ERROR","ERROR":{"CODE":"ERR_API_CHECKSUM_INCORRECT","MESSAGE":""}}
{"STATE":"ERROR","ERROR":{"CODE":"ERR_API_PRO_USERS_ONLY","MESSAGE":"You need to have an active Professional package to use the API. You can upgrade or convert your current package to Pro at https:\/\/www.pambill.com\/shop\/extend\/"}}
{"STATE":"ERROR","ERROR":{"CODE":"ERR_API_ACTION_NOT_SUPPORTED","MESSAGE":"Supported ACTION values are: import, import_shopify, validate_token, validate_account, pambill_package, latest_order_number"}}
Estas solicitudes de ejemplo se pueden enviar a la API de PamBill en https://pambill.com/api. Cada solicitud solo se ejecutará correctamente una vez y devolverá ERR_API_DUPLICATED_REQUEST en todos los intentos subsiguientes. Esto se debe a que la API requiere un CALL_ID único para cada llamada.
Dado que el CALL_ID se utiliza para calcular la suma de comprobación (CHECKSUM), no se puede modificar fácilmente en la solicitud. La suma de comprobación (CHECKSUM) también debe actualizarse. Cambiar el valor del token también generará una suma de comprobación incorrecta, ya que cada token público tiene un token privado (secreto) correspondiente que debe utilizarse para calcular la suma de comprobación.
{"VERSION": "1.2",
"ORIGIN": "WooCommerceApp",
"TOKEN": "Ii5haDTn40023KI9Y57a3aD77P1f9NG6",
"CALL_ID": "1661240906651DF892KQY9A969g2o15e",
"ACTION": "import",
"CHECKSUM": "6025eed28d1abc79f0c200c7d4ae7428e1a23469e1b56eede3333bd3fae3a5a8",
"DATA": [{
"order_number": "1001",
"order_date": "2025-08-05T11:00:00-05:00",
"currency": "USD",
"preferred_language": "en",
"prices_include_vat": true,
"payment": {
"provider": "PayPal",
"paid_at": null,
"price_gross": null
},
"discount": {
"price_gross": 10,
"code": "Gift Voucher"
},
"refund": {
"price_gross": 100,
"cancelled_at": null,
"reason": null
},
"billing_address": {
"address1": "2259 Park Ct",
"address2": "Apartment 5",
"city": "Drayton Valley",
"company": "Gorski & Partners",
"company_vat": "DE250438265",
"country_code": "CA",
"email": "bob.norman@mail.example.com",
"salutation": "Mr.",
"first_name": "Christopher",
"last_name": "Gorski",
"name": "Christopher Gorski",
"notes": null,
"phone": "+13125551212",
"region": "Alberta",
"zip": "T0E 0M0"
},
"shipping_address": {
"address1": "123 Amoebobacterieae St",
"address2": "",
"city": "Ottawa",
"company": null,
"country_code": "CA",
"email": "bob.bobsen@mail.example.com",
"salutation": null,
"first_name": "Bob",
"last_name": "Bobsen",
"name": "Bob Bobsen",
"notes": null,
"phone": "555-625-1199",
"region": "Ontario",
"zip": "K2P0V6"
},
"items": [{
"quantity": 1,
"price_gross": "199.99",
"sku": "IPOD-342-N",
"name": "IPod Nano",
"variant": "Pink",
"apply_reduced_vat": false,
"apply_no_vat": false,
"special_vat_rate": null
},
{
"quantity": 2,
"price_gross": "15",
"sku": "CASE-01",
"name": "Universal Phone Case",
"variant": null,
"apply_reduced_vat": false,
"apply_no_vat": false,
"special_vat_rate": null
},
{
"quantity": 1,
"price_gross": "9.99",
"sku": null,
"name": "100% Arabica",
"variant": "500g",
"apply_reduced_vat": true,
"apply_no_vat": false,
"special_vat_rate": null
},
{
"quantity": 1,
"price_gross": "21.29",
"sku": null,
"name": "Bio Espresso Decaf",
"variant": "1000g",
"apply_reduced_vat": false,
"apply_no_vat": false,
"special_vat_rate": "3.7"
},
{
"quantity": 1,
"price_gross": "10.00",
"sku": null,
"name": "Something VAT-exempt",
"variant": null,
"apply_reduced_vat": false,
"apply_no_vat": true,
"special_vat_rate": null
}],
"shipping": {
"delivery": {
"price_gross": "9.99",
"type": null
},
"post_fee": {
"price_gross": null,
"type": null
}
}
}]
}
curl -i -X POST -H 'Content-Type: application/json' -d '{"VERSION":"1.2","ORIGIN":"WooCommerceApp","TOKEN":"Ii5haDTn40023KI9Y57a3aD77P1f9NG6","CALL_ID":"1661240906651DF892KQY9A969g2o15e","ACTION":"import","CHECKSUM":"6025eed28d1abc79f0c200c7d4ae7428e1a23469e1b56eede3333bd3fae3a5a8","DATA":[{"order_number":"1001","order_date":"2025-08-05T11:00:00-05:00","currency":"USD","preferred_language":"en","prices_include_vat":true,"payment":{"provider":"PayPal","paid_at":null,"price_gross":null},"discount":{"price_gross":10,"code":"Gift Voucher"},"refund":{"price_gross":100,"cancelled_at":null,"reason":null},"billing_address":{"address1":"2259 Park Ct","address2":"Apartment 5","city":"Drayton Valley","company":"Gorski & Partners","company_vat":"DE250438265","country_code":"CA","email":"bob.norman@mail.example.com","salutation":"Mr.","first_name":"Christopher","last_name":"Gorski","name":"Christopher Gorski","notes":null,"phone":"+13125551212","region":"Alberta","zip":"T0E 0M0"},"shipping_address":{"address1":"123 Amoebobacterieae St","address2":"","city":"Ottawa","company":null,"country_code":"CA","email":"bob.bobsen@mail.example.com","salutation":null,"first_name":"Bob","last_name":"Bobsen","name":"Bob Bobsen","notes":null,"phone":"555-625-1199","region":"Ontario","zip":"K2P0V6"},"items":[{"quantity":1,"price_gross":"199.99","sku":"IPOD-342-N","name":"IPod Nano","variant":"Pink","apply_reduced_vat":false,"apply_no_vat":false,"special_vat_rate":null},{"quantity":2,"price_gross":"15","sku":"CASE-01","name":"Universal Phone Case","variant":null,"apply_reduced_vat":false,"apply_no_vat":false,"special_vat_rate":null},{"quantity":1,"price_gross":"9.99","sku":null,"name":"100% Arabica","variant":"500g","apply_reduced_vat":true,"apply_no_vat":false,"special_vat_rate":null},{"quantity":1,"price_gross":"21.29","sku":null,"name":"Bio Espresso Decaf","variant":"1000g","apply_reduced_vat":false,"apply_no_vat":false,"special_vat_rate":"3.7"},{"quantity":1,"price_gross":"10.00","sku":null,"name":"Something VAT-exempt","variant":null,"apply_reduced_vat":false,"apply_no_vat":true,"special_vat_rate":null}],"shipping":{"delivery":{"price_gross":"9.99","type":null},"post_fee":{"price_gross":null,"type":null}}}]}' https://www.pambill.com/api
© 2013-2025. PamBill es propiedad y está operado por PamConsult Software und Beratungsgesellschaft mbH, Alemania.
Política de privacidad | Condiciones de servicio | Aviso legal