Customer API
A customer represents a customer in your system. Use the Customers API to create and retrieve customer specific information.
PUT
/v1/customers
Request Body
Type Description Format
CustomerId string ID of the customer. If ID is not provided, ID will be autogenerated.
Minimum length: 5
Maximum length: 100
Pattern: ^[A-Za-z0-9\-]{5,100}$
Name string Name of the customer.
Minimum length: 1
Maximum length: 50
Pattern: ^[A-Za-z0-9_\-\s]{1,50}$
Email string Email address of the customer.
Address object Address of the customer.
ReferralKey string Referral key used during signup.
A successful request returns HTTP 201 and a JSON response body that includes the ID of the customer.
Type Description
Customer object New customer.
                        
    curl -X PUT https://api.stack.promo/v1/customers \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Basic <credentials>' \
    -d '{
            "name": "John",
            "email": "john@stack.promo"
        }'
                            
                        
                        
                        
    {
        "customer": {
            "customerId": "b0b09e0ec8e545f7a159104e23bddb77"
        }
    }
                        
                        
GET
/v1/customers/{id}/promotions
Type Description Format
Id string ID of the customer
Minimum length: 1
Maximum length: 100
Pattern: ^[A-Za-z0-9\-]{1,100}$
A successful request returns HTTP 200 OK status code and a JSON response body that shows promotion details.
Type Description
Promotions object Array of promotions.
                        
    curl -X GET https://api.stack.promo/v1/customers/b0b09e0ec8e545f7a159104e23bddb77/promotions \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Basic <credentials>'
                        
                        
                            
{
    "promotions": [
        {
            "id": "c9305025cb81418f8f6367b50c312610",
            "name": "Get $10 on us",
            "currencyCode": "AUD",
            "amount": 10.0,
            "promotionType": "Discount",
            "promotionValueType": "Fixed Amount"
        }
    ]
}
                             
                        
GET
/v1/customers/{id}/wallets
Type Description Format
Id required string ID of the customer
Minimum length: 1
Maximum length: 100
Pattern: ^[A-Za-z0-9\-]{1,100}$
A successful request returns HTTP 200 OK status code and a JSON response body that shows wallet details.
Type Description
Wallets object Array of wallets.
                        
    curl -X GET https://api.stack.promo/v1/customers/b0b09e0ec8e545f7a159104e23bddb77/wallets \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Basic <credentials>'
                        
                        
                            
{
    "wallets": [
        {
            "id": "e8884eec4fa6403f9e5323e5862e8057",
            "amountType": "Cash",
            "currencyCode": "AUD",
            "balance": 0.0
        },
        {
            "id": "1412c2df6ca04e41bbf27a051048d8e7",
            "amountType": "Points",
            "currencyCode": "LOY",
            "balance": 0.0
        }
    ]
}
                             
                        
Type Description Format
State string The state.
Minimum length: 1
Maximum length: 100
Pattern: ^[A-Za-z0-9\-\s]{1,50}$
Country string The two-character ISO 3166-1 code of the country.
Minimum length: 2
Maximum length: 2
Pattern:Pattern: ^([A-Z]{2}|C2)$
Type Description
CustomerId string ID of the customer.
Type Description
Id string ID of the promotion.
Name string Name of the promotion.
Description string Description of the promotion.
PromotionType string Type of promotion.
CurrencyCode string Currency code.
Amount decimal Promotion amount.
PromotionValueType string Indicates whether the amount is fixed amount or percentage.
Type Description
Id string ID of the wallet.
AmountType string Indicates whether the balance is cash or points.
CurrencyCode string Currency code.
Balance decimal Wallet balance.
PromotionValueType string Indicates whether the amount is fixed amount or percentage.