Skip to main content

APIs

This section describes the available APIs and their usage.

note

Checkout

Create Checkout

The create-checkout API allows you to create a new checkout.

Endpoint: /create-checkout

Method: POST

Request Body

The request body should include the following parameters:

  • amount (number): The amount for the checkout. It should be a numeric value greater than zero.
  • currency (string): The currency for the checkout. It should be one of the allowed request currencies ("USD" OR "EUR").
  • itemName (string, optional): The name of the item associated with the checkout.
  • itemId (string, optional): The ID of the item associated with the checkout.
  • note (string, optional): Additional note for the checkout.
  • clientId (string, optional): The ID of the client associated with the checkout.
  • items (array): Array of item included in checkout.

Example Request:


const createCheckout = async () => {
try {
const response = await axiosInstance.post("/create-checkout", {
amount: 250,
apiKey:"684315e5-7f83-446a-bb8b-64fc95c0fc4d",
currency:"USD",
itemName:"Ginger Tea",
note: "Additional note",
itemId: "xyz123",
items:[
{
itemName: "Test Item",
price: 50,
qty: 5,
taxRate: 1.5
}
],
note:"Test payment"
});

console.log(response.data);
} catch (error) {
console.error(error);
}
};

createCheckout();

Example Response:

{
"quotes": [],
"payments": [],
"items": [
{
"itemName": "Test Item",
"price": 50,
"qty": 5,
"taxRate": 1.5,
"taxAmount": 3.75,
"subTotal": 250,
"total": 253.75
}
],
currencies: [
{
"currencyId": "d6a93955-5e65-48f4-8c5e-68c1a7dc30a5",
"currencyName": "USDG",
"currencyFullName": "Globiance USD Stablecoin",
"currencyType": "blockchain",
"currencyNetwork": null
},
{
"currencyId": "d6a93955-5e65-48f4-8c5e-68c1a7dc30a5",
"currencyName": "USDG",
"currencyFullName": "Globiance USD Stablecoin",
"currencyType": "wallet",
"currencyNetwork": null
},
{
"currencyId": "2fa87932-da60-4427-894a-986775c292da",
"currencyName": "TRX",
"currencyFullName": "TRON",
"currencyType": "blockchain",
"currencyNetwork": null
},
{
"currencyId": "2fa87932-da60-4427-894a-986775c292da",
"currencyName": "TRX",
"currencyFullName": "TRON",
"currencyType": "wallet",
"currencyNetwork": null
},
{
"currencyId": "20849003-e854-4c2d-84f1-1025caba56d8",
"currencyName": "BTC",
"currencyFullName": "Bitcoin",
"currencyType": "wallet",
"currencyNetwork": null
},
{
"currencyId": "e591415d-683b-47fa-a2cb-faf7a5b9cc65",
"currencyName": "EURG",
"currencyFullName": "Globiance EUR Stablecoin",
"currencyType": "blockchain",
"currencyNetwork": null
},
{
"currencyId": "e591415d-683b-47fa-a2cb-faf7a5b9cc65",
"currencyName": "EURG",
"currencyFullName": "Globiance EUR Stablecoin",
"currencyType": "wallet",
"currencyNetwork": null
},
{
"currencyId": "c7a82c43-7e48-4012-a70e-6e2e2b61d58f",
"currencyName": "USDT",
"currencyFullName": "Tether USD",
"currencyType": "wallet",
"currencyNetwork": null
},
{
"currencyId": "c7a82c43-7e48-4012-a70e-6e2e2b61d58f",
"currencyName": "USDT",
"currencyFullName": "Tether USD",
"currencyType": "blockchain",
"currencyNetwork": "TRX"
},
{
"currencyId": "eb68220f-c269-428e-9c1f-d59846b55e49",
"currencyName": "XDC",
"currencyFullName": "XinFin Network",
"currencyType": "wallet",
"currencyNetwork": null
},
{
"currencyId": "eb68220f-c269-428e-9c1f-d59846b55e49",
"currencyName": "XDC",
"currencyFullName": "XinFin Network",
"currencyType": "blockchain",
"currencyNetwork": "XDC"
},
{
"currencyId": "20849003-e854-4c2d-84f1-1025caba56d8",
"currencyName": "BTC",
"currencyFullName": "Bitcoin",
"currencyType": "blockchain",
"currencyNetwork": null
}
],
"enableFIATBuy": true,
"requestCurrency": "USD",
"requestCurrencyAmount": 253.75,
"requestCurrencyPriceUsd": 1,
"amountInUSD": 253.75,
"duration": 1800000,
"checkoutTime": "2024-10-15T11:07:03.846Z",
"expiryTime": "2024-10-15T11:37:03.846Z",
"note": "Test Payment",
"clientId": null,
"itemId": null,
"itemName": "Ginger Tea",
"status": "pending",
"checkoutId": "b02d7b3e-94c2-4c89-a4f2-e010e59ebf42",
"merchantDirectAcquiring": true,
"merchantDirectAcquiringId": 2
}

Create Invoice Checkout

The create-invoice-checkout API allows you to create a new checkout just like create-checkout but additionally creates a payment link which can be shared to your client for payment. If you pass an email , globiance will also send a mail containing payment link to that email.

Endpoint: /create-invoice-checkout

Method: POST

Request Body

The request body should include the following parameters:

  • amount (number): The amount for the checkout. It should be a numeric value greater than zero.
  • currency (string): The currency for the checkout. It should be one of the allowed request currencies ("USD" OR "EUR").
  • itemName (string, optional): The name of the item associated with the checkout.
  • itemId (string, optional): The ID of the item associated with the checkout.
  • note (string, optional): Additional note for the checkout.
  • clientId (string, optional): The ID of the client associated with the checkout.
  • items (array): Array of item included in checkout.
  • email ( optional ): Email address where you want to send this invoice
  • checkoutDuration ( optional ): Duration for which this checkout link will be valid in milliseconds. Default is 30 days
  • language ( optional ): Default language in which the invoice will be shown. Below are the various valid options:
    • en: English
    • ar: Arabic
    • de: German
    • zh-cn: Chinese (Simplified)
    • es: Spanish
    • fr: French
    • it: Italian
    • ja: Japanese
    • ko: Korean
    • pt: Portuguese
    • tr: Turkish

Example Request:


const createInvoiceCheckout = async () => {
try {
const response = await axiosInstance.post("/create-invoice-checkout", {
amount: 250,
apiKey:"684315e5-7f83-446a-bb8b-64fc95c0fc4d",
currency:"USD",
itemName:"Ginger Tea",
note: "Additional note",
itemId: "xyz123",
items:[
{
itemName: "Test Item",
price: 50,
qty: 5,
taxRate: 1.5
}
],
note:"Test payment",
email:"john@example.com",
checkoutDuration: 30*60*1000
});

console.log(response.data);
} catch (error) {
console.error(error);
}
};

createInvoiceCheckout();

Example Response:

The API will respond with the created checkout details.

{
"message": "checkout created",
"data": {
"quotes": [
{
"currencyId": "AC90FA93-754C-4B36-9E62-A3AAD96B27ED",
"currencyName": "XDC",
"currencyType": "wallet",
"currencyFullName": "XinFin Network",
"network": null,
"feePercent": 1,
"amount": 6114.8674452,
"fee": 61.14867445,
"total": 6176.01611965
}
],
"payments": [],
"items": [
{
"itemName": "Test Item",
"price": 50,
"qty": 5,
"taxRate": 1.5,
"taxAmount": 3.75,
"subTotal": 250,
"total": 253.75
}
],
"requestCurrency": "USD",
"requestCurrencyAmount": 253.75,
"requestCurrencyPriceUsd": 1,
"amountInUSD": 253.75,
"duration": 1800000,
"checkoutTime": "2023-10-19T11:41:50.181Z",
"expiryTime": "2023-10-19T12:11:50.181Z",
"note": "Test payment",
"clientId": null,
"itemId": null,
"itemName": "Ginger Tea",
"status": "pending",
"checkoutId": "63adb2cb-27a8-45b1-ab1a-f47ecde31ae8",
"merchantDirectAcquiring": true,
"merchantDirectAcquiringId": 2
},
paymentLink: "https://invoice.globiance.com/?checkoutId=828a66b7-cc96-4c55-b43d-8afca5a2166f&apiKey=01259e6d-0369-4ff0-8b9c-4481f43239d9"
}

Generate Quote

The generate-quote API allows you to retrieve a quote for a specific currency and checkout.

To generate address this api is pre-requisites first you need to fetch quote then on basis of this you can make a call to generate address.

Endpoint

/generate-quote

Method

POST


Request Body

The request body must include the following parameters:

  • currencyId (string): The unique identifier for the currency.
  • apiKey (string): Your API key for authentication.
  • checkoutId (string): The ID of the checkout for which the quote is being generated.
  • currencyType (string): The type of currency being used. For blockchain currencies, specify "blockchain".

Example Request

const generateQuote = async () => {
try {
const response = await axiosInstance.post("/generate-quote", {
currencyId: "eb68220f-c269-428e-9c1f-d59846b55e49",
apiKey: "dbb04ff6-f419-46b4-990c-f99fe11bb660",
checkoutId: "44b19e4a-fab6-4433-98ad-b567f9487edb",
currencyType: "blockchain"
});

console.log(response.data);
} catch (error) {
console.error(error);
}
};

generateQuote();

Example Response

Upon a successful request, the API will respond with details of the generated quote:

{
"currencyId": "eb68220f-c269-428e-9c1f-d59846b55e49",
"currencyName": "XDC",
"currencyType": "blockchain",
"currencyFullName": "XinFin Network",
"network": null,
"currencyNetwork": null,
"feePercent": 0,
"fee": 0,
"baseAmount": 101.4,
"amount": 101.4,
"subTotal": 101.4,
"networkSurchargeAmountUsd": 0,
"networkSurchargeAmount": 0,
"total": 101.4
}

Generate Address

The generate-address API allows you to generate an address for a specific checkout.

Before this api you need to fetch Quote using Generate-Quote api.

Endpoint: /generate-address

Method: POST

Request Body

The request body should include the following parameters:

  • currencyId(string): The ID of the currency associated with the checkout.
  • checkoutId(string): The ID of the checkout for which the address is generated.
  • network (string, optional): The network for the address (if applicable).

Example Request:


const generateAddress = async () => {
try {
const response = await axiosInstance.post("generate-address", {
currencyId: "c123",
checkoutId: "checkout123",
network: "Ethereum"
});

console.log(response.data);
} catch (error) {
console.error(error);
}
};

generateAddress();

Example Response:

The API will respond with the generated address details.

{
"message": "successfully got the address",
"data": {
"address": "xdc85d4485040b5870c2f3b8a66cef7d08fe9c8dec1",
"destinationTag": null
}
}

Cancel Checkout

The cancel-checkout API allows you to generate an address for a specific checkout.

Endpoint: /cancel-checkout

Method: POST

Request Body

The request body should include the following parameters:

  • checkoutId(string): The ID of the checkout to cancel.

Example Request:


const cancelCheckout = async () => {
try {
const response = await axiosInstance.post("cancel-checkout", {
checkoutId: "checkout123"
});

console.log(response.data);
} catch (error) {
console.error(error);
}
};

cancelCheckout();

Example Response:

The API will respond with the cancel checkout message.

{
"message": "checkout cancelled"
}

Get Checkout Details

The get-checkout-details API allows you to generate an address for a specific checkout.

Endpoint: /get-checkout-details

Method: POST

Request Body

The request body should include the following parameters:

  • checkoutId(string): The ID of the checkout to retrieve details.

Example Request:


const getCheckoutDetails = async () => {
try {
const response = await axiosInstance.post("get-checkout-details", {
apiKey: "API_KEY",
checkoutId: "63adb2cb-27a8-45b1-ab1a-f47ecde31ae8",
});

console.log(response.data);
} catch (error) {
console.error(error);
}
};

getCheckoutDetails();

Example Response:

The API will respond with the checkout details.

{
"data": {
"currencies": [...],
"payments": [],
"store": {
"logo": "https://merchant-api.globiancepay.com/merchant-dashboard-api-service/merchant-logo/9da84c8f-dbd6-4392-a418-4ce1025fb3f3.png",
"labelName": "Mega Store",
"apiKey": "684315e5-7f83-446a-bb8b-64fc95c0fc4d",
"isActive": true,
"taxId": null,
"showTaxId": false,
"taxRate": 0
},
"items": [
{
"itemName": "Test Item",
"itemId": null,
"price": 50,
"qty": 5,
"taxRate": 1.5,
"taxAmount": 3.75,
"subTotal": 250,
"total": 253.75
}
],
"requestCurrency": "USD",
"requestCurrencyAmount": 253.75,
"requestCurrencyPriceUsd": 1,
"amountInUSD": 253.75,
"duration": 1800000,
"checkoutTime": "2023-10-19T11:41:50.181Z",
"expiryTime": "2023-10-19T12:11:50.181Z",
"note": "Test payment",
"clientId": null,
"itemId": null,
"itemName": "Ginger Tea",
"status": "pending",
"checkoutId": "63adb2cb-27a8-45b1-ab1a-f47ecde31ae8",
"merchantDirectAcquiring": true,
"merchantDirectAcquiringId": 2
}
}

Get Payment Details

The get-payment-details API allows you to generate an address for a specific checkout.

Endpoint: /get-payment-details

Method: POST

Request Body

The request body should include the following parameters:

  • paymentId(string): The ID of the payment to retrieve details.

Example Request:


const getPaymentDetails = async () => {
try {
const response = await axiosInstance.post("get-payment-details", {
paymentId: "payment123"
});

console.log(response.data);
} catch (error) {
console.error(error);
}
};

getPaymentDetails();

Example Response:

The API will respond with the payment details.

{
"data": {
"paymentId": "a596ef60-ffb1-11ed-b395-4318d66a581b",
"currencyId": "AC90FA93-754C-4B36-9E62-A3AAD96B27ED",
"currencyName": "XDC",
"createdAt": "2023-05-31T12:49:57.078Z",
"amount": 328.19740551062,
"status": "confirmed",
"isUnderDispute": false,
"disputeType": null,
"transactionType": "wallet",
"transactionDetail": {
"amount": 328.19740551062,
"payerUserId": "4C5ABF65-0A54-4BC6-93F7-4B10689BC780",
"payerEmail": "gb***************"
},
"paymenStatusHistory": [
{
"paymentId": "a596ef60-ffb1-11ed-b395-4318d66a581b",
"action": "processing",
"metadata": null,
"createdAt": "2023-05-31T12:49:57.089Z"
},
{
"paymentId": "a596ef60-ffb1-11ed-b395-4318d66a581b",
"action": "confirmed",
"metadata": null,
"createdAt": "2023-05-31T12:49:57.095Z"
},
{
"paymentId": "a596ef60-ffb1-11ed-b395-4318d66a581b",
"action": "settled",
"metadata": null,
"createdAt": "2023-05-31T12:49:57.271Z"
}
]
}
}

Direct Acquiring

Prerequisite

Before initiating a card payment using Direct Acquiring, you must first create a checkout using the create-checkout or create-invoice-checkout API.

The checkoutId returned from the checkout creation response is required for Direct Acquiring requests.

When a merchant wants their customer to pay directly using a card, they can use one of the following APIs depending on the merchantAcquiringId (0, 1, 2, or 3) provided in the checkout session.


Provider 0

Endpoint: /initiate-pay-with-card

Method: POST

Request Body:

{
"apiKey": "bfc0a8a2-d940-44a4-87b1-848c93f68a80",
"checkoutId": "a1792f7a-76c2-4651-b2b7-d60bf9ded31d",
"saveMyCard": false,
"firstName": "John",
"lastName": "Doe",
"address": "Test, NY, US",
"country": "US",
"state": "Test",
"city": "Test",
"zip": "75000",
"email": "test@gmail.com",
"phoneNumber": "03008911111",
"cardNumber": "4444333322221111",
"cardExpiryMonth": "01",
"cardExpiryYear": "2023",
"cardCvvNumber": "123",
"screenWidth": 1440,
"screenHeight": 900,
"language": "en-GB",
"javaEnabled": false,
"javascriptEnabled": true,
"colorDepth": 24,
"utcOffset": -300
}
  • apiKey (string): Merchant API key.
  • checkoutId (string): ID of the checkout session.
  • saveMyCard (boolean): Whether to save the card for future use.
  • firstName, lastName, address, country, state, city, zip, email, phoneNumber, cardNumber, cardExpiryMonth, cardExpiryYear, cardCvvNumber (standard billing info)
  • Device/browser info: screenWidth, screenHeight, language, javaEnabled, javascriptEnabled, colorDepth, utcOffset

Responses:

{
"status": "success",
"require3ds": false,
"message": "Payment Completed.",
"provider": 0,
"checkoutLink": "https://invoice.globiancepay.com/?apiKey=bfc0a8a2-d940-44a4-87b1-848c93f68a80&checkoutId=a1792f7a-76c2-4651-b2b7-d60bf9ded31d",
"metadata": {
"status": "success",
"message": "Payment Completed.",
"descriptor": null,
"transactionRef": "yDe1b3C571eoGfSE"
},
"transactionRef": "yDe1b3C571eoGfSE",
"descriptor": null
}
  • provider: 0
    • require3ds: true and 3dsUrl: open the 3DS URL for verification.
    • status: success: payment completed.
    • status: failed: payment failed.

Next Steps After Response:

  • If status === "success" and require3ds === false:

    • Display a success message to the user: Payment Successful!
  • If require3ds === true and 3dsUrl is provided:

    • Open 3dsUrl in a new browser tab or window for 3DS verification.
    • Optionally display a message like: "Please verify this transaction."
  • If status === "failed":

    • Notify the user: Payment failed, please try again.

Provider 1

Endpoint: /initiate-pay-with-card

Method: POST

Request Body:

{
"apiKey": "bfc0a8a2-d940-44a4-87b1-848c93f68a80",
"checkoutId": "a1792f7a-76c2-4651-b2b7-d60bf9ded31d",
"saveMyCard": false,
"firstName": "John",
"lastName": "Doe",
"address": "Test, NY, US",
"country": "US",
"state": "Test",
"city": "Test",
"zip": "75000",
"email": "test@gmail.com",
"phoneNumber": "03008911111",
"cardNumber": "4444333322221111",
"cardExpiryMonth": "01",
"cardExpiryYear": "2023",
"cardCvvNumber": "123",
"screenWidth": 1440,
"screenHeight": 900,
"language": "en-GB",
"javaEnabled": false,
"javascriptEnabled": true,
"colorDepth": 24,
"utcOffset": -300
}
  • apiKey (string): Merchant API key.
  • checkoutId (string): ID of the checkout session.
  • saveMyCard (boolean): Whether to save the card for future use.
  • firstName, lastName, address, country, state, city, zip, email, phoneNumber, cardNumber, cardExpiryMonth, cardExpiryYear, cardCvvNumber (standard billing info)
  • Device/browser info: screenWidth, screenHeight, language, javaEnabled, javascriptEnabled, colorDepth, utcOffset

Responses:

{
"status": "success",
"require3ds": false,
"message": "Payment Completed.",
"provider": 0,
"checkoutLink": "https://invoice.globiancepay.com/?apiKey=bfc0a8a2-d940-44a4-87b1-848c93f68a80&checkoutId=a1792f7a-76c2-4651-b2b7-d60bf9ded31d",
"metadata": {
"status": "success",
"message": "Payment Completed.",
"descriptor": null,
"transactionRef": "yDe1b3C571eoGfSE"
},
"transactionRef": "yDe1b3C571eoGfSE",
"descriptor": null
}
  • provider: 1
    • status: 3ds: redirect using metadata for 3DS verification.
    • status: success: payment completed.
    • status: failed: display failure.

Next Steps After Response:

  • If status === "3ds" and require3ds === true and action === "3ds":

    • Redirect the user to the 3DS page via a form POST using values from:
      • metadata.URL
      • metadata.PaReq
      • metadata.MD
      • metadata.termUrl
  • If status === "success":

    • Display: Payment Successful! We are processing it shortly.
  • If status === "failed":

    • Notify the user: Payment failed, please try again.

Provider 2

Endpoint: /initiate-pay-with-card-widget

Method: POST

Request Body:

{
"firstName": "Test",
"middleName": "",
"lastName": "Test last Name",
"email": "Test@gmail.com",
"phoneNumber": "03008911111",
"apiKey": "4dc1f8e2-da82-456f-a27f-5154aa4d2b5f",
"checkoutId": "03fe1fb8-8878-4855-bc3e-83f98a912fc3"
}
  • firstName, middleName, lastName, email, phoneNumber, apiKey, checkoutId

Response:

{
"status": "pending",
"require3ds": false,
"3dsUrl": "1150E75A9DFAFB0A146F1A7375715D6E.prod02-vm-tx08",
"action": "3ds",
"provider": 2,
"checkoutLink": "https://invoice.globiancepay.com/?apiKey=4dc1f8e2-da82-456f-a27f-5154aa4d2b5f&checkoutId=03fe1fb8-8878-4855-bc3e-83f98a912fc3",
"metadata": {
"result": {
"code": "000.200.100",
"description": "successfully created checkout"
},
"buildNumber": "a988d488f2bc437debe1f7bfba9959d71d4fccba@2025-04-10 07:45:36 +0000",
"timestamp": "2025-04-30 13:23:58+0000",
"ndc": "1150E75A9DFAFB0A146F1A7375715D6E.prod02-vm-tx08",
"id": "1150E75A9DFAFB0A146F1A7375715D6E.prod02-vm-tx08",
"redirectUrl": "https://merchant.globiancepay.com/card-transaction-2/?=1150E75A9DFAFB0A146F1A7375715D6E.prod02-vm-tx08"
},
"transactionRef": "1150E75A9DFAFB0A146F1A7375715D6E.prod02-vm-tx08"
}
  • Returns id and redirectUrl.
  • Redirect user to: ${REACT_APP_MERCHANT_UI}/process-transaction?id=${id}

Next Steps After Response:

  • Always redirect the user to:
    ${REACT_APP_MERCHANT_UI}/process-transaction?id=${id}
    where id is from resp.data.data.metadata.id.

  • This screen will handle further steps, including 3DS if required.

  • Optionally inform the user: "Please complete payment in the opened tab."

For Transaction Status of Provider 2

  • Endpoint:
    POST https://merchant-api.globiancepay.com/merchant-dashboard-api-service/public/get-card-txn-status/{id}

  • Request Parameter:

    • id (path param): The transaction ID
  • Response:

{
"data": {
"status": "success"
}
}
  • status (string): One of the following
    • success: Payment was successful
    • failure: Payment failed
    • pending: Transaction is still being processed

Provider 3

Endpoint: /initiate-pay-with-card-widget-2

Method: POST

Request Body:

{
"firstName": "Test",
"middleName": "",
"lastName": "Test last name",
"email": "test@gmail.com",
"phoneNumber": "03008911111",
"apiKey": "e4e34d1f-5ee9-4afb-a992-2b17f695def6",
"checkoutId": "833eecf4-e70f-490b-99f2-5c7d37bcf9a7"
}
  • firstName, middleName, lastName, email, phoneNumber, apiKey, checkoutId

Responses:

{
"data": {
"status": "pending",
"require3ds": false,
"3dsUrl": "https://valenspay-test.valenspay.com/en/PaymentGateway2?orderId=be495814-d764-4102-ae67-e5ec316693f8&type=redirect",
"action": "3ds",
"provider": 3,
"checkoutLink": "https://invoice.globiancepay.com/?apiKey=e4e34d1f-5ee9-4afb-a992-2b17f695def6&checkoutId=833eecf4-e70f-490b-99f2-5c7d37bcf9a7",
"metadata": {
"statusCode": 200,
"errorCode": "EG000",
"message": "Request Successful.",
"data": {
"orderId": "be495814-d764-4102-ae67-e5ec316693f8",
"customerId": "a36baae5-4143-4553-9c1f-7023c49b0fef",
"amount": 5.59,
"currency": "USD",
"status": "New",
"paymentUrl": "https://valenspay-test.valenspay.com/en/PaymentGateway2?orderId=be495814-d764-4102-ae67-e5ec316693f8&type=redirect",
"correlationId": "dd987329-7d99-4bc8-bb01-41c41b8cef9d"
},
"requestId": "0HNC73GR9GPH2:00000002"
},
"transactionRef": "be495814-d764-4102-ae67-e5ec316693f8"
}
}
  • If status !== failed and 3dsUrl is present: open 3DS for verification.
  • Otherwise, display a payment failure notification.

Next Steps After Response:

  • If status !== "failed" and 3dsUrl is provided:
    • Open 3dsUrl in a new tab for user verification.
    • Display: "Please complete the payment in the opened window."
  • If status === "failed":
    • Display: Payment failed, please try again.

For Transaction Status of Provider 2

  • Endpoint:
    POST https://merchant-api.globiancepay.com/merchant-dashboard-api-service/public/get-card-txn-status-gen/{id}

  • Request Parameter:

    • id (path param): The transaction ID
  • Response:

{
"data": {
"status": "pending",
"amount": 5.59,
"currency": "USD",
"createdAt": "2025-04-30T13:20:03.511Z"
}
}
  • status (string): One of the following
    • success: Payment was successful
    • failed: Payment failed
    • pending: Transaction is still being processed

Subscription

Create User Subscription

Endpoint: /create-user-subscription

Method: POST

Description: Creates a new user subscription.

Request Body:

  • planId (string, UUID): The ID of the subscription plan.
  • customerId (string): The ID of the customer.
  • customerEmail (string): The email address of the customer.
  • startsAt (string, optional): The start date of the subscription.
  • note (string, optional): Additional notes for the subscription. Must be a valid JSON string.

Example Request:

{
"planId": "123e4567-e89b-12d3-a456-426614174000",
"customerId": "cust123",
"customerEmail": "customer@example.com",
"startsAt": "2023-08-01T00:00:00Z",
"note": "{"key":"value"}"
}

Response:

{
"message": "subscription created",
"data": {
"link": "https://subscription.globiance.dev/subscription/6ae4d823-ae90-4de7-a325-9779e3da0bc1",
"subscriptionUserId": "6ae4d823-ae90-4de7-a325-9779e3da0bc1"
}
}

Get User Subscription

Endpoint: /get-user-subscription

Method: POST

Description: Retrieves the details of a user subscription.

Request Body:

  • userSubscriptionId (string, UUID): The ID of the user subscription.

Example Request:

{
"userSubscriptionId": "123e4567-e89b-12d3-a456-426614174000"
}

Response:

{
"data": {
"planId": "6ae4d823-ae90-4de7-a325-9779e3da0bc1",
"customerId": "XXX-TEA-STORE-XXX-002",
"customerEmail": "xyz@xyz.com",
"status": "pending",
"planCyclePeriod": "W",
"planCycle": 1,
"planStart": "2024-08-12T07:24:48.031Z",
"planEnd": "2024-09-23T07:24:48.031Z",
"planCost": 100,
"planCurrency": "USD",
"planGraceTime": 2,
"planGraceTimePeriod": "D",
"planGracePeriodType": "post-period",
"totalPaidCycles": 0,
"remainingCycles": 6,
"prepaidSubscriptionStarts": null,
"prepaidSubscriptionEnds": null,
"nextPaymentOn": null
}
}

Pause User Subscription

Endpoint: /pause-user-subscription

Method: POST

Description: Pauses an active user subscription.

Request Body:

  • userSubscriptionId (string, UUID): The ID of the user subscription.

Example Request:

{
"userSubscriptionId": "123e4567-e89b-12d3-a456-426614174000"
}

Response:

{
"subscriptionId": "sub123",
"status": "paused",
"message": "Subscription paused successfully."
}

Resume User Subscription

Endpoint: /resume-user-subscription

Method: POST

Description: Resumes a paused user subscription.

Request Body:

  • userSubscriptionId (string, UUID): The ID of the user subscription.

Example Request:

{
"userSubscriptionId": "123e4567-e89b-12d3-a456-426614174000"
}

Response:

{
"subscriptionId": "sub123",
"status": "active",
"message": "Subscription resumed successfully."
}

Cancel User Subscription

Endpoint: /cancel-user-subscription

Method: POST

Description: Cancels an active user subscription.

Request Body:

  • userSubscriptionId (string, UUID): The ID of the user subscription.

Example Request:

{
"userSubscriptionId": "123e4567-e89b-12d3-a456-426614174000"
}

Response:

{
"subscriptionId": "sub123",
"status": "canceled",
"message": "Subscription canceled successfully."
}

Here's the API documentation with clearly labeled response types: