Manuais
PHC GO Create Partial Receipt
 

Method


The method to be called is:




Parameters


In the request headers the Authorization header must have the Access Token:


  • Authorization: {{accessToken}}


JSON body


In the body of the POST a JSON structure like this one has to be passed:


{
"customer": {
"number": 16,
"estab": 0
},

"requestOptions": {
"option": 0,
"requestedFields": [
"restamp"
],

"reportName": "Recibo Minimal",
"toProcess": 1
},

"document": {
"docType": 1
},

"invoices": [
{
"invoiceStamp": "4f5-42ff-9da0-24f8ed36194",
"valueToReceive": 10
},

{
"invoiceStamp": "5c1-4f49-ab29-32b57fb4600",
"valueToReceive": 5.4
}
]
}

 

Return Information


Any call made to this method will return a JSON information with this structure:

  1. If the option value is “0”:

     
    {
    "code": 0,
    "message": "Information saved with success and mail sent to client",
    "requestedFields": {} /** OBJECT CONTAINING THE REQUESTED FIELDS FROM requestOptions **/
    }

  2. If the option value is “1":

     
    {
    "code": 1,
    "message": "Information saved with success.",
    "pdf": "LINK FOR THE DOCUMENT PDF",
    "requestedFields": {} /** OBJECT CONTAINING THE REQUESTED FIELDS FROM requestOptions **/
    }

  3. In case of error:

     
    {
    "code": 100,
    "message": "Error message"
    }

  4. In case of success but with printing error:

     
    {
    "code": 50,
    "message": "Information saved with success. Error printing the document."
    }


JSON Specification for Create Partial Receipt



Request Options


 
Name Type PHC GO Entity PHC GO Field Observations
option1 Integer 0 – Send document by email

1 – Return document pdf link to print
requestedFields String Array The PHC GO document entity fields to be returned on Success
reportName String Name of the report type the document should have. If not defined will use one of the reports the user has access to

Ex. “Recibo Minimal”
emailBody String Send document by email with specific body
emailSubject String Send document by email with specific subject
toProcess Integer 0 – Just create Receipt

1 – To sign Receipt

 

Customer1


 
Name Type PHC GO Entity PHC GO Field Observations
number1 Integer Cl no  
estab Integer Cl estab By default it goes 0

 

Document


 
Name Type PHC GO Entity PHC GO Field Observations
docType1 Integer Tsre ndoc Type of document to create

Defaults:
1 – Normal Receipt

 

Invoices


 
Name Type PHC GO Entity PHC GO Field Observations
invoiceStamp1 String Ft ftstamp Stamp of invoice to be in receipt
valueToReceive Double Rl erec Value to receive for that invoice

By default is the total of invoice

 

Footnotes


1 - Required

 

Examples


 

Create receipt for 2 invoices:


The JSON structure to create one receipt with 2 invoices and regularize part of both invoices


 
  1. Firstly we need to change the docType field from the Document request object to 1 (Normal Receipt).

  2. On Invoices List, we only have to pass the following fields:
     
    • invoiceStamp (required) – invoice reference
    • valueToReceive(optional) – Is the partial value to receive from specific invoice (by default is total of invoice)


Information
 
You can find the receipt document type values by going to Company Settings page and selecting Receipt Series.