4WS Suite
Home
API Reference
  • Data mangement API
  • Documents API
Home
API Reference
  • Data mangement API
  • Documents API
Fourwayshop
  1. Giftcard
  • Document Manager
    • Orders
      • Save Sale Order
      • Save Return Order
    • Orchestrated Orders
      • Orchestrated Order
      • Orchestrated Return order
      • Orchestrated Update order
    • Cart
      • Cart Validation
      • Cart Full Validation
    • Sales
      • Save receipt
      • Salve only Order
      • Replace or update sale
      • Get last digital order
    • Warehouse
      • Save Entry from supplier
      • Save Transfer document
      • Save Free Entry
    • Purchase
      • Save Purchase
    • Get Document
      GET
    • Update Document external references
      POST
  • Customer
    • Get Customer
      GET
    • Set Customer Opt-in
      POST
  • Loyalty vouchers
    • Get customer loyalty vouchers
      GET
    • Get loyalty vouchers at a time interval
      GET
    • Get last loyalty vouchers
      GET
  • Giftcard
    • Get Giftcard
      GET
    • Update Giftcard
      POST
    • Generate Gift Card Barcode
      POST
    • Gift Card PDF Generation
      POST
  • Stock
    • Get Stock
      POST
    • Get last stock
      GET
    • Insert Stock
      POST
  1. Giftcard

Update Giftcard

POST
/api
Last modified:2025-02-07 15:16:52
To activate or update a giftcart it's necessary to make a POST call, passing a JSON body as specified below.
This web service is asynchronous, this means that the operation is enqueued. If a callback has been specified in the request, this callback will be called in POST when the queue has ended.


The web service response will be composed of:
success: Boolean that indicated wether the request was successful enqueued or not

Actors#

API Client: The system or user initiating the request.
4ws.trade: The backend system that processes the request.

Examples#

Example of activation of a giftcard#

  {
    entityCode : 440,
    barcode: "0098260111383",
    amount : 100.0,
    activationDate : "2021-08-31 10:00:00",
    country : "IT",
    branchCode : "1150",
    priceList : "1150",
    currencySymbol : "€",
    currency : "EUR",
    clientBarcode : "clientBarcode",
    clientCode : "clientCode",
    clientDenomination : "GINO"
  }


Example of consumption of a giftcard#

  {
    entityCode : 440,
    barcode: "0098260111383",
    amount : -50.0,
  }

Fields#

FieldDescriptionTypeMandatory
entityCodeThe entity code String✓
barcodeGiftcard barcode String✓
amountThe consumed (negative) value of the gift card. In case of activation, pass the (positive) value of the gift card number✓
activationDateActivation date with format "yyyy-MM-dd HH:mm:ss", using GMT time StringOnly on insert
countryCountry StringOnly on insert
branchCodeBranch code StringOnly on insert
priceListPrice list StringOnly on insert
currencySymbolCurrency symbol StringOnly on insert
currencyCurrency code StringOnly on insert
clientBarcodeClient barcode String
clientCodeClient code String
clientDenominationClient denomination String
callbackcallback url
payloadin case of callback this payload will be passed

Request

Query Params

Header Params

Body Params text/plain
Example
Example:{ entityCode : 440, barcode: "0098260111383", amount : 100.0, activationDate : "2021-08-31 10:00:00", country : "IT", branchCode : "1150", priceList : "1150", currencySymbol : "€", currency : "EUR", clientBarcode : "clientBarcode", clientCode : "clientCode", clientDenomination : "GINO", callback : "https://..." }

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST '/api?cmd=updateGiftcard_v1&applicationId={{APPLICATION_ID}}&appId={{APPLICATION_ID}}' \
--header 'applicationId: {{APPLICATION_ID}}' \
--header 'appId: {{APPLICATION_ID}}' \
--header 'namespace: {{NAMESPACE}}' \
--header 'languageId: {{LANGUAGE}}' \
--header 'username: {{USERNAME}}' \
--header 'password: {{PASSWORD}}' \
--header 'companyId: {{COMPANY_ID}}' \
--header 'siteId: {{SITE_ID}}' \
--header 'loadRoles: Y' \
--header 'Content-Type: text/plain' \
--data-raw '{
		entityCode : 440,
		barcode: "0098260111383",
		amount : 100.0,
		activationDate : "2021-08-31 10:00:00",
		country : "IT",
		branchCode : "1150",
		priceList : "1150",
		currencySymbol : "€",
		currency : "EUR",
		clientBarcode : "clientBarcode",
		clientCode : "clientCode",
		clientDenomination : "GINO",
        callback : "https://..."
}'

Responses

🟢200Consume Giftcard (GAE Call)
application/json
Body

Example
{
    "success": true,
    "queueId": "f3ff844b-9ee4-4fac-8c50-123ecd91f76e"
}
🟢200Activate Giftcard (GAE Call)
🟠422Unique constraint error
Modified at 2025-02-07 15:16:52
Previous
Get Giftcard
Next
Generate Gift Card Barcode
Built with