Create gift cards
POST https://{handle}.myshopline.com/admin/openapi/v20260301/gift_cards.json
handle : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is open001.myshopline.com , the store handle is open001 .Request Headers
- Content-Type string requiredThe field must be set to the fixed value
application/json; charset=utf-8. - Authorization string requiredThe access token for the API resource. Refer to App authorization to obtain the access token, and then pass the obtained token in the Bearer format.Example:
Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
Request Body
- customer_id stringClient id for customers assigned to present gift cardExample:
4200113946 - expires_on stringExpiration date on current gift cardExample:
2022-08-16T21:20:50+08:00 - initial_value string requiredInitial amount of gift cardExample:
200 - note stringThe note information of the current gift card , the number of characters limited to 500Example:
This is a note - code stringGift card encodingExample:
dbe95e7f02606fc4
Status Codes
- 200
- 401
- 429
For the complete list of codes and messages, see Http status code.
Response Headers
traceId
A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.
Response Body
gift_cardobject
Gift card informationorder_id stringAssociated order idExample:24060486231247568944830202expires_on stringThe expiration date of the current gift card , lol is never expiredExample:2023-08-16T23:59:59+08:00created_at stringGift card creation timeExample:2023-08-16T23:59:59+08:00line_item_id stringAssociated order itemsExample:18060183094426803997483534code stringGift card encodingExample:dbe95e7f02606fc4disabled_at stringGift card disable timeExample:2023-08-16T23:59:59+08:00customer_id stringClient id for customers assigned to present gift cardExample:4200113946id stringGift card idExample:30157043359245339231360282currency stringGift card par currencyExample:CNYapi_client_id stringCall party idExample:30157043359245339231360282initial_value stringInitial amount of gift cardExample:200last_characters stringThe last four characters from codeExample:6fc4note stringNote information for present gift cardExample:This is a notebalance stringGift card balanceExample:200user_id stringAdministrator account id on the admin interface for users to create gift cardsExample:4214250478updated_at stringGift card update timeExample:2023-08-16T23:59:59+08:00
API Explorer
Debugger
Was this article helpful to you?