Credit

Top up your credit.

In case your payment source (credit card) requires 3D validation use the Stripe SDK.

To detect any fraudulent activities and initiate Radar and 3D Secure, integrate handleCardAction from Stripe.js. Reference: https://stripe.com/docs/js/payment_intents/handle_card_action

Example:

<script src="https://js.stripe.com/v3/"></script>
<script>
   // Retrieve Easyship stripe publishable api key through `GET /2024-09/account/stripe`
   var stripe = Stripe('stripe_publishable_api_key');

   // When `POST /2024-09/account/credit` returns status code 202, retrieve the secret in the response.
   var secret = response.action.client_secret

   // 3D validation
   stripe.handleCardAction(secret).then(function (result) {
     if (result.error) {
       // error handling
     } else {
       // You would receive stripe payment_intent object
       // `POST /2024-09/account/credit/confirm_3ds` with payment_intent.id to confirm credit top-up
     }
   });
 </script>

If you are using an authorized bank account as your payment method, the transaction might take around 1 to 3 days to complete.

Required authorization scope: public.payment:write

post/2024-09/account/credit

Request

  • Base URL
    https://public-api.easyship.com
  • URL
    https://public-api.easyship.com/2024-09/account/credit
  • Auth
    HTTP bearer

Request body

payment_source_idstring required

Source ID based on Payment Source API. Your payment source should have the card accept type. Use default card if this property is not provided.

amountnumber required

Amount of credits to be added to a current account.

Response

credit successfully added

Example response

{
  "credit": {
    "currency": "USD"
  }
}

Changes