Reseller Orders

These endpoints allow resellers to generate promotion codes that require payment (bijbetaling), check code status, and retrieve all codes associated with a customer email address.


POST/promotion/generate-payment-code

Generate payment code

Creates a promotion code that requires payment before activation. The payment amount is calculated based on the product price minus any scanner discount configured on the device.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    Bearer token of the authenticated device.

Request body

  • Name
    organization_identifier
    Type
    string
    Description

    Identifier of the organization.

  • Name
    promotion_identifier
    Type
    string
    Description

    UUID of the promotion.

  • Name
    product_id
    Type
    integer
    Description

    ID of the product to be purchased.

  • Name
    location_id
    Type
    integer
    Description

    ID of the location where the code will be activated.

  • Name
    email
    Type
    email
    Description

    Customer email address. If provided, a user account will be created or linked.

Behavior

  • Validates the device, organization, and promotion
  • Calculates payment amount: price - (price * scanner_discount / 100)
  • Creates or links user account if email is provided
  • Generates a unique promotion code with payment requirement
  • Returns a URL with from_scanner=1 flag to prevent back navigation
  • Code expires in 91 days from creation

Request

POST
/promotion/generate-payment-code
curl -X POST "https://api.walletapp.co/promotion/generate-payment-code" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "organization_identifier": "9jYwYpYhu1vWrWsSRlshURzf0a",
    "promotion_identifier": "1cfd74ec-d085-4d05-9b8f-e436c68132ef",
    "product_id": 5377,
    "location_id": 1,
    "email": "customer@example.com"
  }'

Response

{
  "success": true,
  "message": "Bijbetaling link generated successfully",
  "data": {
    "code": "WLNT-ABC-DEF-GHI2",
    "url": "https://promotion-domain.com/promo-ref?promotion_code=WLNT-ABC-DEF-GHI2&from_scanner=1",
    "email": "customer@example.com",
    "user_id": 12345,
    "product": {
      "id": 5377,
      "title": "Premium Car Wash",
      "original_price": "25.00"
    },
    "location": {
      "id": 1,
      "title": "Main Street Location"
    },
    "bijbetaling": {
      "amount": "20.00",
      "discount_percentage": 20
    },
    "expiration_date": "2025-04-15 14:30:00"
  }
}

POST/promotion/check-code-status

Check code status

Retrieves the current status of a promotion code, including activation status, redemption status, payment status, and location information.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    Bearer token of the authenticated device.

Request body

  • Name
    organization_identifier
    Type
    string
    Description

    Identifier of the organization.

  • Name
    promotion_identifier
    Type
    string
    Description

    UUID of the promotion.

  • Name
    code
    Type
    string
    Description

    The promotion code to check (e.g., "WLNT-ABC-DEF-GHI2").

Response fields

  • status: Boolean flags for activated, redeemed, and paid
  • dates: Timestamps for creation, activation, redemption, and expiration
  • user: Email and external identifier (if available)
  • redemption_location: Where the code was redeemed (if redeemed)
  • bijbetaling: Payment requirement details including amount and payment status

Request

POST
/promotion/check-code-status
curl -X POST "https://api.walletapp.co/promotion/check-code-status" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "organization_identifier": "9jYwYpYhu1vWrWsSRlshURzf0a",
    "promotion_identifier": "1cfd74ec-d085-4d05-9b8f-e436c68132ef",
    "code": "WLNT-ABC-DEF-GHI2"
  }'

Response

{
  "success": true,
  "data": {
    "code": "WLNT-ABC-DEF-GHI2",
    "status": {
      "activated": true,
      "redeemed": false,
      "paid": true
    },
    "dates": {
      "created_at": "2025-01-15 10:30:00",
      "activation_date": "2025-01-15 11:00:00",
      "redeemed_at": null,
      "expiration_date": "2025-04-15 10:30:00"
    },
    "user": {
      "email": "customer@example.com",
      "external_identifier": null
    },
    "redemption_location": null,
    "bijbetaling": {
      "required": true,
      "amount": "20.00",
      "paid": true,
      "paid_at": "2025-01-15 10:45:00"
    }
  }
}

POST/promotion/codes-by-email

Get user codes by email

Retrieves all promotion codes associated with an email address for a specific promotion, including their status, dates, locations, and payment information.

Required headers

  • Name
    Authorization
    Type
    string
    Description

    Bearer token of the authenticated device.

Request body

  • Name
    organization_identifier
    Type
    string
    Description

    Identifier of the organization.

  • Name
    promotion_identifier
    Type
    string
    Description

    UUID of the promotion.

  • Name
    email
    Type
    email
    Description

    Customer email address to search for.

Response fields

For each code found:

  • code: The promotion code string
  • status: Activation, redemption, and payment status
  • dates: All relevant timestamps
  • locations: Both activation and redemption locations (with address)
  • product: Product details if linked
  • bijbetaling: Payment requirement and status

Request

POST
/promotion/codes-by-email
curl -X POST "https://api.walletapp.co/promotion/codes-by-email" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "organization_identifier": "9jYwYpYhu1vWrWsSRlshURzf0a",
    "promotion_identifier": "1cfd74ec-d085-4d05-9b8f-e436c68132ef",
    "email": "customer@example.com"
  }'

Response

{
  "success": true,
  "message": "Codes retrieved successfully",
  "data": {
    "email": "customer@example.com",
    "total_codes": 3,
    "codes": [
      {
        "code": "WLNT-ABC-DEF-GHI2",
        "status": {
          "activated": true,
          "redeemed": true,
          "paid": true
        },
        "dates": {
          "created_at": "2025-01-15 10:30:00",
          "activation_date": "2025-01-15 11:00:00",
          "redeemed_at": "2025-01-16 14:20:00",
          "expiration_date": "2025-04-15 10:30:00"
        },
        "locations": {
          "activation_location": {
            "id": 1,
            "title": "Main Street Location",
            "address": "123 Main St, City"
          },
          "redemption_location": {
            "id": 2,
            "title": "Downtown Location",
            "address": "456 Downtown Ave, City"
          }
        },
        "product": {
          "id": 5377,
          "title": "Premium Car Wash",
          "price": "25.00"
        },
        "bijbetaling": {
          "required": true,
          "amount": "20.00",
          "paid": true,
          "paid_at": "2025-01-15 10:45:00"
        }
      },
      {
        "code": "WLNT-XYZ-123-ABC7",
        "status": {
          "activated": false,
          "redeemed": false,
          "paid": false
        },
        "dates": {
          "created_at": "2025-01-20 09:15:00",
          "activation_date": null,
          "redeemed_at": null,
          "expiration_date": "2025-04-20 09:15:00"
        },
        "locations": {
          "activation_location": null,
          "redemption_location": null
        },
        "product": {
          "id": 5378,
          "title": "Basic Wash",
          "price": "15.00"
        },
        "bijbetaling": {
          "required": true,
          "amount": "12.00",
          "paid": false,
          "paid_at": null
        }
      }
    ]
  }
}