1 /**
2 * @oas [post] /admin/gift-cards
3 * operationId: PostGiftCards
4 * summary: Create Gift Card
5 * description: Create a gift card.
6 * x-authenticated: true
7 * x-ignoreCleanup: true
8 * security:
9 * - api_token: []
10 * - cookie_auth: []
11 * - jwt_token: []
12 * requestBody:
13 * content:
14 * application/json:
15 * schema:
16 * $ref: "#/components/schemas/AdminCreateGiftCardParams"
17 * x-codeSamples:
18 * - lang: Shell
19 * label: cURL
20 * source: |-
21 * curl -X POST '{backend_url}/admin/gift-cards' \
22 * -H 'Authorization: Bearer {jwt_token}' \
23 * -H 'Content-Type: application/json' \
24 * --data-raw '{
25 * "code": "{value}",
26 * "value": 19,
27 * "currency_code": "bwp",
28 * "expires_at": "2025-07-20T15:47:23.951Z",
29 * "reference_id": "{value}",
30 * "reference": "{value}",
31 * "line_item_id": "{value}",
32 * "customer_id": "{value}",
33 * "metadata": {}
34 * }'
35 * tags:
36 * - Gift Cards
37 * responses:
38 * "200":
39 * description: OK
40 * content:
41 * application/json:
42 * schema:
43 * $ref: "#/components/schemas/AdminGiftCardResponse"
44 * "400":
45 * $ref: "#/components/responses/400_error"
46 * "401":
47 * $ref: "#/components/responses/unauthorized"
48 * "404":
49 * $ref: "#/components/responses/not_found_error"
50 * "409":
51 * $ref: "#/components/responses/invalid_state_error"
52 * "422":
53 * $ref: "#/components/responses/invalid_request_error"
54 * "500":
55 * $ref: "#/components/responses/500_error"
56 * x-badges:
57 * - text: Plugin
58 * description: |
59 * This API route is only available through the [Loyalty Plugin](https://docs.medusajs.com/resources/commerce-modules/loyalty).
60 *
61 */
62