Distribution
Distributor keys: granted merchants, catalogues, reservations, capture and statements.
Requires a distributor key with distribution:read or distribution:sell scope. Lists the merchants this distributor may currently sell for. Only active grants over active merchants are returned, so a revoked grant disappears immediately. Returns the merchant id and display name only.
distributorAuthAuthorizationBearer <token>A distributor key (ggd_...). Separate from merchant keys; it acts for the distributor, not for a merchant.
Granted merchants
application/json- response
data*array<>curl -X GET 'https://engine-sandbox.globagift.io/v1/distribution/grants'{ "data": [ { "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea", "name": "string" } ]}Requires a distributor key with distribution:read or distribution:sell scope. Returns a uniform 404, identical to a merchant that does not exist, when the distributor has no active grant for merchant_id. Only active products are returned; draft, paused and archived products are never disclosed to a distributor.
distributorAuthAuthorizationBearer <token>A distributor key (ggd_...). Separate from merchant keys; it acts for the distributor, not for a merchant.
merchant_id*stringCard products
application/json- response
data*array<>total?integer0 <= valuelimit?integer1 <= value <= 100offset?integer0 <= value <= 1000000curl -X GET 'https://engine-sandbox.globagift.io/v1/distribution/products?merchant_id=string'{ "data": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "currency": "EUR", "denominations": [ 1 ], "min_amount": 0, "max_amount": 0, "expiry_months": 1, "status": "draft", "paused_reason": "string", "active_design_id": "a4eee967-4c43-4a0e-ab43-626b7bf7880b", "artwork_url": "http://example.com" } ], "total": 0, "limit": 1, "offset": 0}Requires a distributor key with distribution:sell scope and an Idempotency-Key header. Idempotency keys are scoped to the calling distributor. Retrying with the same key and payload returns the original reservation; the same key with a different payload returns 409 idempotency_key_conflict. Send your own order_reference so the sale can be looked up later. ttl_seconds is capped at 3600.
distributorAuthAuthorizationBearer <token>A distributor key (ggd_...). Separate from merchant keys; it acts for the distributor, not for a merchant.
Idempotency-Key*string1 <= length <= 255application/json- body
merchant_id*stringuuidcard_product_id*stringuuidamount*integerInteger minor units; for example 1250 means EUR 12.50.
1 <= value <= 1000000000000currency*string^[A-Za-z]{3}$order_reference?stringYour own order or sale reference, unique per distributor. If omitted, a reference is generated.
1 <= length <= 255ttl_seconds?integerHow long the float stays held before it is released automatically.
1 <= value <= 3600900Reservation held
application/json- response
id*stringuuidorder_reference*stringstatus*string"held""captured""released""expired"amount*integerInteger minor units; for example 1250 means EUR 12.50.
0 <= valuecurrency*string^[A-Z]{3}$expires_at*stringdate-timecreated_at*stringdate-timesettled_at*|nullcard_id*|nullcurl -X POST 'https://engine-sandbox.globagift.io/v1/distribution/reservations' \ -H 'Idempotency-Key: string' \ -H 'Content-Type: application/json' \ -d '{ "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea", "card_product_id": "61f1cb74-007e-466f-97a9-d7820aabc97f", "amount": 1, "currency": "EUR"}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "order_reference": "string", "status": "held", "amount": 0, "currency": "EUR", "expires_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "settled_at": "2019-08-24T14:15:22Z", "card_id": "66f6e46c-f6a1-4af8-a1bd-49666bc01304"}Requires distribution:read or distribution:sell scope. Returns the distributor's own reservation status, timestamps, amount, currency, reservation id and card id. Unknown references and references belonging to another distributor return the same uniform 404.
distributorAuthAuthorizationBearer <token>A distributor key (ggd_...). Separate from merchant keys; it acts for the distributor, not for a merchant.
order_reference*string1 <= length <= 255Distributor order reservation
application/json- response
id*stringuuidorder_reference*stringstatus*string"held""captured""released""expired"amount*integerInteger minor units; for example 1250 means EUR 12.50.
0 <= valuecurrency*string^[A-Z]{3}$expires_at*stringdate-timecreated_at*stringdate-timesettled_at*|nullcard_id*|nullcurl -X GET 'https://engine-sandbox.globagift.io/v1/distribution/orders/string'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "order_reference": "string", "status": "held", "amount": 0, "currency": "EUR", "expires_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "settled_at": "2019-08-24T14:15:22Z", "card_id": "66f6e46c-f6a1-4af8-a1bd-49666bc01304"}Requires distribution:sell scope. Unknown reservation ids, reservations belonging to another distributor, and reservations whose merchant grant has since been revoked all return the same uniform 404. Replayable: capturing an already-captured reservation returns 200 with the same reservation and card again, so a lost response is recoverable. The claim code is returned only on the first successful capture and is never returned again, so store it before acknowledging the sale.
distributorAuthAuthorizationBearer <token>A distributor key (ggd_...). Separate from merchant keys; it acts for the distributor, not for a merchant.
id*stringReservation captured; card and claim code included. On a replayed capture the same card is returned without a claim code.
application/json- response
reservation*card*curl -X POST 'https://engine-sandbox.globagift.io/v1/distribution/reservations/string/capture'{ "reservation": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "order_reference": "string", "status": "held", "amount": 0, "currency": "EUR", "expires_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "settled_at": "2019-08-24T14:15:22Z", "card_id": "66f6e46c-f6a1-4af8-a1bd-49666bc01304" }, "card": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "state": "created", "currency": "EUR", "amount": 0, "claim_code": "string", "redemption_code": "string", "payment_reference": "string", "acceptance_point_id": "cb7fe03a-d13a-4fa6-9fe2-dcdbba794774", "whatsapp_delivery": { "sent": true, "to_masked": "string", "reason": "string" }, "email_delivery": { "sent": true, "to_masked": "string", "reason": "string" }, "redemption_code_last4": "stri", "expires_at": "2019-08-24T14:15:22Z", "card_design_id": "e9676ab8-4ee1-4a63-b3d4-c9176075bb1b", "artwork_url": "http://example.com", "balance": 0, "issued_at": "2019-08-24T14:15:22Z", "order_id": "93101167-9065-4b9c-b98b-5d789a3ed9fe" }}Requires distribution:sell scope. Unknown reservation ids and reservations belonging to another distributor both return the same uniform 404.
Retries: not idempotent. After an unclear failure, read the current state before trying again.
distributorAuthAuthorizationBearer <token>A distributor key (ggd_...). Separate from merchant keys; it acts for the distributor, not for a merchant.
id*stringReservation released
curl -X DELETE 'https://engine-sandbox.globagift.io/v1/distribution/reservations/string'Requires distribution:read or distribution:sell scope. One row per ledger posting against the caller's own float in currency, oldest first, covering both the available and reserved balances. Only the calling distributor's own activity is returned. Each line names the balance it affected (available or reserved) and, where applicable, the reservation id and card id, so a reserve's two equal-and-opposite rows are distinguishable and every line ties back to a sale. A prefund has neither and reads null on both.
distributorAuthAuthorizationBearer <token>A distributor key (ggd_...). Separate from merchant keys; it acts for the distributor, not for a merchant.
currency*string3 <= length <= 3from?stringInclusive date/time boundary for the resource timestamp named by this parameter.
date-timeto?stringInclusive date/time boundary for the resource timestamp named by this parameter.
date-timeStatement lines
application/json- response
data*array<>curl -X GET 'https://engine-sandbox.globagift.io/v1/distribution/statements?currency=str'{ "data": [ { "entry_type": "string", "amount_minor": 0, "at": "2019-08-24T14:15:22Z", "pocket": "available", "reservation_id": "b947feb5-3593-40ee-8244-4428da3fe32d", "card_id": "66f6e46c-f6a1-4af8-a1bd-49666bc01304" } ]}