Sale Note API

With the REST API for Sale Notes, you can attach information to a successful sale at a later time. This information is then shown in the order details of the DigiWallet Backoffice.

HTTP Bearer Authentication

This API requires HTTP Bearer authentication (Read more...) This means your requests to this API must always be accompanied by an HTTP header carrying your organization's API key to be accepted.

You can find your organization's unique API token in your Organization Dashboard.

An example of the HTTP header is as follows:

Authorization: Bearer 12a34bc5de67f8g9012345678

RESTful API

This is a RESTful API. This means the API follows the RESTful format for web services (Read more...)

The response format for these API's is in (JSON). A typical response will be a JSON-encoded array with a status integer to indicate whether the call was successful or not, and a message string with a description of what happened.

Beyond these standard elements, an API can return API-specific information. e.g. transactionID integer for the creation of a transaction. Or a nested errors array providing detailed validation errors.

The HTTP response codes of the RESTful API's follow the below logic:

HTTP Status Code Used in response to
200 (Success) A successfully processed request that also returns information
201 (Created) A successfully processed creation request
202 (Accepted) A successfully accepted job request
400 (Bad Request) Bad input parameters / validation errors
401 (Unauthorized) Bad credentials
404 (Not Found) Resource could not be found
405 (Method Not Allowed) Method is unsupported in the API
500 (Internal Server Error) A problem occurred at DigiWallet's servers

Create Method Create new note

To create a new note, call the following API through HTTP POST.

https://api.digiwallet.nl/sale-note

With the following parameters (* = required):

Variable Explanation Example
outletID* The outlet ID of the original transaction. 12345
paymentMethodCode* The ID of the payment method of the original transaction. Refer to the values below:
  • AFP: AfterPay
  • MRC: Bancontact
  • BWI: Bank wire
  • CRC: Creditcard
  • DRD: DirectDebit
  • IDE: iDEAL
  • PSC: paysafecard
  • SOF: SOFORT
IDE
saleID* The ID of the original transaction. 12345678
text* The contents of the note. Final Invoice Number #12345
test When enabled, the given saleID doesn't need to exist.
Notes will be created in a test administration that you can still reference, but they won't show up in the DigiWallet Backoffice.
Note that when you have your outlet set to test-mode through the DigiWallet Dashboard, this parameter will be forced to 1.

Remember to turn off this option when the site goes live. The default is, test mode off.
"1" or "0"

You will then get a JSON-encoded array response with the following content:

Key Value
status 0
message SaleNote successfully created
saleNoteID ID of the created note

Example raw response

{"status":0,"message":"SaleNote successfully created","saleNoteID":12345}


In case of one or more errors, you will get a JSON-encoded array response with the following content:

Key Value
status 1
message Validation failed
errors Nested JSON-encoded array of validation errors

Example

Key Value
saleID Sale not found.
text Text cannot be blank.

Example raw response

{"status":1,"message":"Validation failed","errors":{"saleID":["Sale not found."],"text":["Text cannot be blank."]}}

Check in case of errors if the parameters are correctly taken from the documentation. If this seems to be the case. Please contact DigiWallet and mention the error message.

Update Method Update existing note

To update an existing note, call the following API through HTTP PATCH.

https://api.digiwallet.nl/sale-note/<outletID>/<saleID>/<paymentMethodCode>/<text>[/<test>]

With the following parameters (* = required):

Variable Explanation Example
outletID* The outlet ID of the original transaction. 12345
paymentMethodCode* The ID of the payment method of the original transaction. Refer to the values below:
  • AFP: AfterPay
  • MRC: Bancontact
  • BWI: Bank wire
  • CRC: Creditcard
  • DRD: DirectDebit
  • IDE: iDEAL
  • PSC: paysafecard
  • SOF: SOFORT
IDE
saleID* The ID of the original transaction. 12345678
text* The contents of the note. Final Invoice Number #12345
test When enabled, the given saleID doesn't need to exist.
Notes will be created in a test administration that you can still reference, but they won't show up in the DigiWallet Backoffice.
Note that when you have your outlet set to test-mode through the DigiWallet Dashboard, this parameter will be forced to 1.

Remember to turn off this option when the site goes live. The default is, test mode off.
"1" or "0"

You will then get a JSON-encoded array response with the following content:

Key Value
status 0
message SaleNote successfully updated
saleNoteID ID of the updated note

Example raw response

{"status":0,"message":"SaleNote successfully updated","saleNoteID":12345}


In case of one or more errors, you will get a JSON-encoded array response with the following content:

Key Value
status 1
message Validation failed
errors Nested JSON-encoded array of validation errors

Example

Key Value
saleID Sale not found.
text Text cannot be blank.

Example raw response

{"status":1,"message":"Validation failed","errors":{"saleID":["Sale not found."],"text":["Text cannot be blank."]}}

Check in case of errors if the parameters are correctly taken from the documentation. If this seems to be the case. Please contact DigiWallet and mention the error message.

Delete Method Delete existing note

To delete an existing note, call the following API through HTTP DELETE.

https://api.digiwallet.nl/sale-note/<outletID>/<saleID>/<paymentMethodCode>[/<test>]

The query string parameters are defined as follows (* = required):

Variable Explanation Example
outletID* The outlet ID of the original transaction. 12345
paymentMethodCode* The ID of the payment method of the original transaction. Refer to the values below:
  • AFP: AfterPay
  • MRC: Bancontact
  • BWI: Bank wire
  • CRC: Creditcard
  • DRD: DirectDebit
  • IDE: iDEAL
  • PSC: paysafecard
  • SOF: SOFORT
IDE
saleID* The ID of the original transaction. 12345678
test When enabled, the given saleID doesn't need to exist.
Notes will be created in a test administration that you can still reference, but they won't show up in the DigiWallet Backoffice.
Note that when you have your outlet set to test-mode through the DigiWallet Dashboard, this parameter will be forced to 1.

Remember to turn off this option when the site goes live. The default is, test mode off.
"1" or "0"

You will then get a JSON-encoded array response with the following content:

Key Value
status 0
message SaleNote successfully deleted

Example raw response

{"status":0,"message":"SaleNote successfully deleted"}


In case of one or more errors, you will get a JSON-encoded array response with the following content:

Key Value
status 1
message Validation failed
errors Nested JSON-encoded array of validation errors

Example

Key Value
saleID Sale not found.

Example raw response

{"status":1,"message":"Validation failed","errors":{"saleID":["Sale not found."]}}

Check in case of errors if the parameters are correctly taken from the documentation. If this seems to be the case. Please contact DigiWallet and mention the error message.