Obtener cupón de ecommerce
curl --request GET \
--url https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"_id": "<string>",
"websiteId": "<string>",
"code": "<string>",
"name": "<string>",
"description": "<string>",
"type": "percentage",
"active": true,
"percentageOff": 123,
"maxPercentageOffDiscount": 123,
"discountAmount": 123,
"fixedAmount": 123,
"fromDate": "2020-01-01T00:00:00.000Z",
"endDate": "2020-01-01T00:00:00.000Z",
"maxRedemptions": 123,
"maxRedemptionsPerUser": 123,
"maxRedemptionsPerUserPerDay": true,
"maxRedemptionsPerCode": 123,
"totalRedemptions": 123,
"onlyForNewUsers": true,
"onlyForProductsWithoutDiscount": true,
"requirePhoneVerification": true,
"requiresCategoriesIds": [
"<string>"
],
"requiresProductsIds": [
"<string>"
],
"requiresStoresIds": [
"<string>"
],
"requiresMenusIds": [
"<string>"
],
"requiresPaymentTypes": [
"<string>"
],
"requireChannels": [
"<string>"
],
"requiredBINs": [
"<string>"
],
"minimumOrderPrice": 123,
"maximumOrderPrice": 123,
"dontApplyToProductsIds": [
"<string>"
],
"dontApplyDiscountToOptions": true,
"isHidden": true,
"allowedEmails": [
"<string>"
],
"externalId": "<string>",
"isBirthdayCoupon": true,
"onlyRedeemOnBirthday": true,
"autoRecommend": true,
"applyDeliveryDiscount": true,
"deliveryDiscountValue": 123,
"deliveryDiscountType": "<string>",
"deliveryDiscountPercentage": 123,
"maxProductsPerOrder": 123,
"createdAt": "2020-01-01T00:00:00.000Z",
"deletedAt": "2020-01-01T00:00:00.000Z",
"codes": [
{
"_id": "<string>",
"code": "<string>",
"websiteId": "<string>",
"couponId": "<string>",
"totalRedemptions": 123,
"userEmail": "<string>",
"sentToEmail": "<string>",
"createdAt": "2020-01-01T00:00:00.000Z",
"deletedAt": "2020-01-01T00:00:00.000Z"
}
]
}
}{
"success": "false",
"error": {
"error": "error",
"message": "The request has an error"
}
}Cupones
Obtener cupón de ecommerce
Obtiene un cupón ecommerce de la marca autorizada. Puede incluir sus códigos activos usando withCodes=true.
GET
/
ecommerce
/
coupons
/
{couponId}
Obtener cupón de ecommerce
curl --request GET \
--url https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.service.getjusto.com/v3/ecommerce/coupons/{couponId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"_id": "<string>",
"websiteId": "<string>",
"code": "<string>",
"name": "<string>",
"description": "<string>",
"type": "percentage",
"active": true,
"percentageOff": 123,
"maxPercentageOffDiscount": 123,
"discountAmount": 123,
"fixedAmount": 123,
"fromDate": "2020-01-01T00:00:00.000Z",
"endDate": "2020-01-01T00:00:00.000Z",
"maxRedemptions": 123,
"maxRedemptionsPerUser": 123,
"maxRedemptionsPerUserPerDay": true,
"maxRedemptionsPerCode": 123,
"totalRedemptions": 123,
"onlyForNewUsers": true,
"onlyForProductsWithoutDiscount": true,
"requirePhoneVerification": true,
"requiresCategoriesIds": [
"<string>"
],
"requiresProductsIds": [
"<string>"
],
"requiresStoresIds": [
"<string>"
],
"requiresMenusIds": [
"<string>"
],
"requiresPaymentTypes": [
"<string>"
],
"requireChannels": [
"<string>"
],
"requiredBINs": [
"<string>"
],
"minimumOrderPrice": 123,
"maximumOrderPrice": 123,
"dontApplyToProductsIds": [
"<string>"
],
"dontApplyDiscountToOptions": true,
"isHidden": true,
"allowedEmails": [
"<string>"
],
"externalId": "<string>",
"isBirthdayCoupon": true,
"onlyRedeemOnBirthday": true,
"autoRecommend": true,
"applyDeliveryDiscount": true,
"deliveryDiscountValue": 123,
"deliveryDiscountType": "<string>",
"deliveryDiscountPercentage": 123,
"maxProductsPerOrder": 123,
"createdAt": "2020-01-01T00:00:00.000Z",
"deletedAt": "2020-01-01T00:00:00.000Z",
"codes": [
{
"_id": "<string>",
"code": "<string>",
"websiteId": "<string>",
"couponId": "<string>",
"totalRedemptions": 123,
"userEmail": "<string>",
"sentToEmail": "<string>",
"createdAt": "2020-01-01T00:00:00.000Z",
"deletedAt": "2020-01-01T00:00:00.000Z"
}
]
}
}{
"success": "false",
"error": {
"error": "error",
"message": "The request has an error"
}
}Obtiene el detalle de un cupón ecommerce de la marca autorizada. El identificador puede ser el
_id interno o el externalId cuando exista.
Usa withCodes=true sólo cuando necesites incluir códigos asociados en la misma respuesta. Para auditar códigos en forma paginada, usa el endpoint de listado de códigos.