Upload Invoice in pdf

SetInvoicePDF. For an order that has reached at least the ready_to_ship status, allows the upload of the tax document in PDF format.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

ABOUT THE SIGNATURE

To sign the request, the string to sign is the concatenated result of:

The following headers from the request, sorted by name:

  • Action
  • Format
  • Service
  • Timestamp
  • UserID
  • Version
  • Excluding the Signature parameter.

The names and values must be URL-encoded according to the RFC 3986 standard, concatenated with the '=' character. Each set of parameters (name=value) must be separated with the '&' character.

Then, using the API key, the signature should be calculated using the SHA256 algorithm.

You can take the following PHP example as a reference:

<?php

// Set the timezone if it's not configured correctly in php.ini
date_default_timezone_set("UTC");

// Default headers
$headers = [
    'accept' => 'application/json',
    'content-type' => 'application/json'
];

// Request data
$userID = '[email protected]';
$apiVersion = '1.0';
$action = 'FeedList';
$format = 'JSON';
$service = 'Invoice';

// Get the current timestamp in ISO 8601 format
$timestamp = date('c');

// Parameters for the signature
$parametersForSignature = [
    'UserID' => $userID,
    'Version' => $apiVersion,
    'Action' => $action,
    'Format' => $format,
    'Timestamp' => $timestamp,
    'Service' => $service
];

// Sort the parameters by name
ksort($parametersForSignature);

// URL-encode the parameters
$encodedParameters = [];
foreach ($parametersForSignature as $name => $value) {
    $encodedParameters[] = rawurlencode($name) . '=' . rawurlencode($value);
}

// Concatenate the URL-encoded parameters into a string
$concatenatedParameters = implode('&', $encodedParameters);

// API key associated with the UserID
$apiKey = 'b1bdb357ced10fe4e9a69840cdd4f0e9c03d77fe';

// Calculate the signature and add it to the headers
$signature = hash_hmac('sha256', $concatenatedParameters, $apiKey, false);
$headers['Signature'] = rawurlencode($signature);

// Merge the headers for the request
$requestHeaders = array_merge($headers, $parametersForSignature);

print_r($requestHeaders);

 

🚧

Important

Remember that this upload is not allowed for those orders where falabella.com issues the invoice on behalf of the seller, meaning when the ShipmenType is Own Warehouse.

Errors

Error CodeMessage
E004Invoice with invoice number %s already exists
E004Max limit reached. Total number of invoice documents should be less than or equal to total items in an order
E004Invalid seller order item status for document %s
E004Order contains FBF items. PDF upload only supports FBS orders.
E004Invoice date must be less than or equal to current date
E004OrderItem(s) not found %s
E007Login failed. Signature mismatching
E1000Internal Application Error
Body Params
orderItemIds
array of strings
required

The identifier of the order item IDs that must be included in the document.

orderItemIds*
string
required

The document number. It must be equal to the NroDTE and Folio fields in the XML body.

date
required

Document date.

string
enum
required

The document type name. Note: BOLETA is not valid for Colombia (FACO).

Allowed:
string
enum
required

Country code. FACL = Chile, FACO = Colombia, FAPE = Peru.

Allowed:
string
required
Defaults to pdf

Invoice Document Format

string
required

Document PDF as a base64 encoded string.

Headers
string
required

The user ID making the call. The list of authorized users is maintained in the Seller Center web interface under Settings/User Management.

string
required

The API version against which this call will be executed, in major.minor format. It must currently be 1.0, even though the actual API version is 2.6.20. If omitted, an error message 'E001: Parameter Version is mandatory' will be returned.

date
required

The current time in ISO8601 format relative to UTC (e.g., Timestamp=2015-04-01T10:00:00+02:00 for Berlin), so that the calls cannot be replayed by a third party listening (i.e., calls that are too far in the past or future produce an error message). Mandatory. If not provided, the error message "E001: Parameter Timestamp is mandatory" will be returned. If the timestamp is too old or in the future, the error message "E003: Timestamp has expired" will be returned.

string
required

The cryptographic signature that authenticates the request. A caller must create this value by calculating the SHA256 hash of the request, using the API key of the user specified in the UserID parameter. Required. If omitted, an error message "E001: Parameter Signature is mandatory" is returned. If the signature is incorrect, an 'E007: Login failed' error message for signature mismatch is returned.

string
required
Defaults to SetInvoicePDF

Name of the function to be called. Required and must be 'GetBrands' in this case. If omitted, an error 'E001: Parameter Action is mandatory' is returned. If an unknown function string is provided, an error message 'E008: Invalid Action' is returned.

string
required
Defaults to JSON

If provided, it must be 'JSON' or 'XML'. If not provided, 'XML' is assumed.

string
required
Defaults to Invoice
string
enum
Defaults to application/json

Generated from available request content types

Allowed:
Responses

Language
LoadingLoading…
Response
Choose an example:
application/json