4WS Suite
Home
API Reference
  • Data mangement API
  • Documents API
Home
API Reference
  • Data mangement API
  • Documents API
Fourwayshop
  1. Customer
  • 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. Customer

Set Customer Opt-in

POST
/api
Last modified:2025-02-07 15:15:57
This web service update the customer opt-it data for the passed fidelity card barcode.
To update the customer, it's necessary to make a POST call, passing a JSON body as specified below.
The web service response will be composed of:
success: Boolean that indicated wether the request was successful or not
message: An error message
Possible errors are:
missing_parameter
customer_not_found

Actors#

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

Update Opt-in#

{
    "barcode": "9999003622498",
    "optinWallet": "Y",
    "walletId": "captainwallet"
}

Fields#

Customer data#

FieldDescriptionTypeMandatory
barcodeMain addressString✓
optinWalletY/N if opt-in is enableString✓
walletIdThe wallet idString

Request

Query Params

Header Params

Body Params text/plain
Example
Example:{ "barcode": "9999003622498", "optinWallet": "Y", "walletId": "captainwallet" }

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 --request POST '/api?cmd=setCustomerOptIn_v1&applicationId=MOBILE_SHOP&appId=MOBILE_SHOP' \
--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 '{
    "barcode": "9999003622498",
    "optinWallet": "Y",
    "walletId": "captainwallet"
}'

Responses

🟢200Set Customer Opt-in - Success
application/json
Body

Example
{
    "success": true
}
🟢200Set Customer Opt-in - Fail
🟠422Unique constraint error
Modified at 2025-02-07 15:15:57
Previous
Get Customer
Next
Get customer loyalty vouchers
Built with