Complete Invoice
  • 07 Apr 2022
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Complete Invoice

  • Dark
    Light
  • PDF

Article summary

Use the Complete Invoice web service to complete a created invoice that is successfully pre-authorized on PayOne SmartLink interface.  

Syntax

POST rest/InvoicesService/completeInvoice

Service Specifications

Property and Information
  • Endpoint: completeInvoice
  • Name: Complete Invoice Service
  • Method: POST
  • Input Parameters: invoice, a JSON formatted object.
  • Parameters Type: Form parameters that need to be set in the body of the HTTP request.
  • Path: rest/InvoicesService/completeInvoice. The path is prefixed with the SmartLink Context root.

Input Parameters

ParameterDescription
merchantID
required
An alphanumeric value that represents the Merchant ID. The Payment Gateway operation team provides this value based on the merchant enrollment. 
  • Field Type: Alphanumeric
  • Length: 30
  • Sample Data: testMercahnt
authenticationToken 
required
An alphanumeric value that represents the Authentication Token. The Payment Gateway operation team provides this value based on the merchant enrollment. 
  • Field Type: Alphanumeric
  • Length: 255
  • Sample Data: N2FiZDRmYTQzNDUzOGM0YTI4N2I5YmZm

invoicesDetails
required

Array of JSON Objects contains the details for each invoice. The details of each invoice is described in the below table.

  • Field Type: Array of JSON Objects
  • Length: N/A
  • Sample Data:
    "invoicesDetails":[{
    "invoiceID":"30231175",
    "amount":"100",
    "currency":"840"
    }]

InvoicesDetails Parameters

ParameterDescription
invoiceID
required
An alphanumeric value that represents the Invoice ID. The invoice ID is a unique value for each invoice. 

  • Field Type: Alphanumeric
  • Length: 60
  • Sample Data: 56534333
amount
required
A numeric value that represents the amount to be used in the completion.
The value is in ISO format with no decimal point.

  • Field Type: Numeric
  • Length: 9
  • Sample Data: 22
currency
required
The numeric ISO Code for the currency.
The value is in ISO format with no characters. Also, the value is the same as the currency that you sent in the request.

  • Field Type: Numeric
  • Length: 3
  • Sample Data: 840

Sample Request

Complete Invoice service request contains the details of the Invoice desired to be completed.

It is in JSON format that contains the following details:

  • merchantID
  • authenticationToken
  • invoicesDetails
    • invoiceID
    • amount 
    • currency
invoice = { "merchantID" : "testMercahnt",
"authenticationToken" :"N2FiZDRmYTQzNDUzOGM0YTI4N2I5YmZm", 
"invoicesDetails":[{
"invoiceID":"30231175",
"amount":"100",
"currency":"840"
}] }

Output Parameters

ParameterDescription

merchantID
required
An alphanumeric value that represents the Merchant ID. The Payment Gateway operation team provides this value based on the merchant enrollment. 
  • Field Type: Alphanumeric
  • Length: 30
  • Sample Data: testMercahnt
authenticationToken
required
An alphanumeric value that represents the Authentication Token. The Payment Gateway operation team provides this value based on the merchant enrollment. 
  • Field Type: Alphanumeric
  • Length: 255
  • Sample Data: N2FiZDRmYTQzNDUzOGM0YTI4N2I5YmZm

invoicesDetails
required

Array of JSON Objects contains the details for each invoice. The details of each invoice is described in the below table.

  • Field Type: Array of JSON Objects
  • Length: N/A
  • Sample Data:
    JSON
    "invoicesDetails":[{
    "invoiceID":"30231175",
    "amount":"100",
    "currency":"840",
    "rrn":"840201608161029435230000000000",
    "status":"success",
    "statusDescription":"INVOICE COMPLETED SUCCESSFULLY"
    }]
    

InvoicesDetails Parameters

ParameterDescription
invoiceID
required
An alphanumeric value that represents the Invoice ID sent in the request. 

  • Field Type: Alphanumeric
  • Length: 60
  • Sample Data: 56534333
amount
required
A numeric value represents the completion amount sent in the request.
The value is in ISO format with no decimal point.

  • Field Type: Numeric
  • Length: 9
  • Sample Data: 100
currency
required
The numeric ISO Code of the currency for the amount parameter. The value is in ISO format with no characters.

  • Field Type: Numeric
  • Length: 3
  • Sample Data: 840
status
required

A value that represents the status of the completed invoice. For example, Expected values are (success, failed). 

 Possible values:
  • Success
  • Failed
  • Field Type: Alphanumeric
  • Length: 10
  • Sample Data: success
statusDescreption
required
A value that represents the Status Description of the complete transaction.

  • Field Type: Alphanumeric
  • Length: 265
  • Sample DataINVOICE COMPLETED SUCCESSFULLY 
rrn
optional
The reference retrieval number of the requested payment.

  • Field Type: Alphanumeric
  • Length: 50
  • Sample Data: 840201608161029435230000000000

Sample Response

Complete Invoice service returns the response in JSON format.

The returned response contains the following details:

  • merchantID
  • authenticationToken
  • invoicesDetails
    • invoiceID
    • amount 
    • currency
    • status
    • rrn
    • statusDescription
{ "authenticationToken" : "ODYxNNTY2ZTI4MmJmMzUyM2VhYmUyMGYx",
"merchantID" : "STSPayOneMerchant" ,
"invoicesDetails":[{
"invoiceID":"30231175",
"amount":"100",
"currency":"840",
"rrn":"840201608161029435230000000000",
"status":"success",
"statusDescription":"INVOICE COMPLETED SUCCESSFULLY"
}]
}