Skip to main content
POST
/
v1
/
publications
curl --request POST \
--url https://{cluster}.voucherify.io/v1/publications \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '{
"campaign": {
"name": "campaign-name"
},
"customer": {
"source_id": "source-id",
"Name": "Customer Name",
"email": "customer email"
},
"voucher": "voucher-code",
"metadata": {
"key": "value"
}
}'
{
"id": "pub_ocaXCa023ayJ3WL1ARxUeKgIvg3JcEGh",
"object": "publication",
"created_at": "2022-09-30T16:30:32.924Z",
"customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS",
"tracking_id": "pub_source_customer_5",
"metadata": {
"year": 2022
},
"channel": "myown",
"source_id": "publication_source_ID_10",
"result": "SUCCESS",
"customer": {
"id": "cust_BB6F97yf0XqCe7hxVUV7M4sS",
"name": "Bob Jones",
"email": "bob.smith@email.com",
"source_id": "pub_source_customer_5",
"metadata": {
"lang": "en",
"test": true
},
"object": "customer"
},
"voucher": {
"id": "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf",
"code": "cEsMn0uA",
"campaign": "Test - Discount Effect - Amount - Items",
"campaign_id": "camp_dphuwqH7BOVkgh4JmpDtS32l",
"category": null,
"category_id": null,
"type": "DISCOUNT_VOUCHER",
"discount": {
"type": "AMOUNT",
"amount_off": 300,
"effect": "APPLY_TO_ITEMS"
},
"gift": null,
"loyalty_card": null,
"start_date": null,
"expiration_date": null,
"validity_timeframe": null,
"validity_day_of_week": null,
"active": true,
"additional_info": null,
"metadata": {},
"assets": {
"qr": {
"id": "U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ+6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA==",
"url": "{{internalVoucherifyURL}}"
},
"barcode": {
"id": "U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn+wFkfzcIZGBtUlxrI2KsXciCqF+c93AKzsymq5Yw8eEAFF/FK5f94z4/sgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA==",
"url": "{{internalVoucherifyURL}}"
}
},
"is_referral_code": false,
"created_at": "2022-09-30T16:30:32.956Z",
"updated_at": null,
"holder_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS",
"redemption": {
"quantity": 1,
"redeemed_quantity": 0,
"object": "list",
"url": "/v1/vouchers/cEsMn0uA/redemptions?page=1&limit=10"
},
"publish": {
"object": "list",
"count": 1,
"url": "/v1/vouchers/cEsMn0uA/publications?page=1&limit=10"
},
"object": "voucher"
},
"vouchers_id": [
"v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf"
]
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

Query Parameters

join_once
boolean

Body

application/json
  • Voucher code
  • Campaign
voucher
string
required
customer
object
required
source_id
string
metadata
object
channel
string

Response

  • Publications Create Voucher Response Body
  • Publications Create Vouchers Response Body
id
string
required
Example:
object
enum<string>
default:publication
required
Available options:
publication
created_at
string<date-time>
required
Example:
customer_id
string
required
Example:
metadata
object
required
channel
enum<string>
default:API
required
Available options:
API
source_id
string | null
required
result
enum<string>
default:SUCCESS
required
Available options:
SUCCESS
customer
object
required
vouchers_id
string[]
required
voucher
object
required
tracking_id
string