Cards API

1. Create Card

Allowed Method: POST
Require Authentication: Yes

A. Request

You can use this API to create a new card.

Parameter

Required

Description

number

Yes

Card number

store

No

Integer indiciating store where the card is activated

Example of API call request using cURL:

$ curl -X POST -H "Content-Type: application/json" -H "Authorization: <token_type> <token>" https://stamps.co.id/api/cards/create -i -d '{ "number": "ABC123456", "store": 1}'

B. Response

Please see Response Codes for a complete list of API response codes.

On a successful API call, Stamps will respond with the following data:

Variable

Description

number

Created card number

C. Examples

A successful API call:

HTTP/1.0 200 OK
Vary: Accept
Content-Type: application/json
Allow: POST, OPTIONS
[Redacted Header]

{
    "number": "ABC123456",
    "is_active": true
}

2. Assign Card

Allowed Method: POST
Require Authentication: Yes

A. Request

You can use this API to assign a card to a user.

Parameter

Required

Description

user

Yes

A string indicating customer’s email, Member ID, mobile number or primary key ID

store

Yes

Integer indicating store where the card is activated

number

Yes

Card number

Example of API call request using cURL:

$ curl -X POST -H "Content-Type: application/json" -H "Authorization: <token_type> <token>" https://stamps.co.id/api/v2/cards/assign-card -i -d '{ "user": "1", "store": "1", "number": "ABC123456"}'

B. Response

Please see Response Codes for a complete list of API response codes.

On a successful API call, Stamps will respond with the following data:

Variable

Description

card

Various card data

C. Examples

A successful API call:

HTTP/1.0 200 OK
Vary: Accept
Content-Type: application/json
Allow: POST, OPTIONS
[Redacted Header]

{
    "card": {
        "id": 1,
        "number": "ABC123456",
        "is_active": true,
        "activated_time": "2024-09-13 10:00:00"
    }
}