chickadee » correios » make-request

make-request #!key service from-zip to-zip (company ) (password ) (pkg-weight 0.3) (pkg-format 1) (pkg-length 16) (pkg-height 2) (pkg-breadth 11) (pkg-diameter 0) (receiver-id-check #f) (declared-value 0) (return-receipt #f) (return-url XML)procedure

Create a correios request object (a defstruct record) to be processed. It has many attributes that correspond to the official Correios web service specification:

SERVICE
available delivery services: 'PAC, 'SEDEX, 'SEDEX-10, 'SEDEX-HOJE and 'SEDEX-A-COBRAR. It can also be a list combining one or more of these symbols (ie. '(PAC SEDEX SEDEX-10)).
FROM-ZIP
sender's zip code and should be a string with 8 digits (only numbers allowed).
TO-ZIP
receiver's zip code and should be a string with 8 digits (only numbers allowed).
COMPANY
company code, if yours has one. It should be a string.
PASSWORD
company password, only if a company code is provided. It should be a string.
PKG-WEIGHT
package weight in kilograms. Should be a number.
PKG-FORMAT
package format and should be a number: 1 for box/package, 2 for roller/prism and 3 for envelope.
PKG-LENGTH
package length in centimeters (including packing size) and should be a number.
PKG-HEIGHT
package height in centimeters (including packing size) and should be a number.
PKG-BREADTH
package breadth in centimeters (including packing size) and should be a number.
PKG-DIAMETER
package diameter in centimeters (including packing size) and should be a number.
RECEIVER-ID-CHECK
a boolean and determines whether the package should be delivered only to the receiver's hand (Correios calls this service "Mão própria").
DECLARED-VALUE
package declared value in Brazillian Reais, to be returned in case of miscarriage. It should be a number - ex.: 33.50 (default is 0, which means no use of service).
RETURN-RECEIPT
a boolean and determines whether the package should be delivered with additional service of a return receipt (#f means no use of the service).
RETURN-URL
request return URL or type - at the moment can only be "XML".

Note: although all values returned use Brazillian decimal notation with a comma separating cents from integers (ex.: 3,25), all the decimal values provided to make-request should have a dot (ex.: 3.25) separating those parts.