MSTS Seller Integration Documentation (Document Version - 2.0.36)

Document Change History

VERSIONCHANGE HISTORY
1.0.0Initial Version.
2.0.0Add currency attribute to the preauthorization and charge API.
2.0.1Add po_number attribute to the preauthorization API and the error codes for po_number validation.
2.0.2Support additional currencies for buyer application.
2.0.3Fix the link to buyer_application.
2.0.4Add a new endpoint for partial return.
Add a new attribute in buyer_application to pass the URL to link to ecommerce site.
Add a new attribute in buyer_application to specify the current charge amount in the shopping cart.
Support update of preauthorization amount
2.0.5Change buyer_application required parameter from buyer_reference_id to client_reference_id.
2.0.6Fix the description for reponse 400
2.0.7Add the new buyer payment term 'End of Month - Net 45'
2.0.8Add a new error code 400 - invalid_input
2.0.9Enhance API Doc, add more descriptions
2.0.10Modify charge endpoints to support discount_amount
2.0.11Add a new error code 405 - method_not_allowed
2.0.12Add shipping_tax_amount to Charge and Return
2.0.13Add shipping_discount_amount to Charge and Return
2.0.14Change url to app.msts.credit
2.0.15Add a new error code 400 - invalid_shipping_amount
2.0.16Change credit_amount_requested, annual_income in BuyerApplication from string to integer
2.0.17Modify charge endpoints to allow for optional metadata parameter
2.0.18Modify the validation pattern of year_established
2.0.19Add Payload of Webhook Event Types
2.0.20Add new payment terms - Net 90
2.0.21Add the daily.charge.activity webhook event
2.0.22Add buyer_client_reference_id and po_number to the daily.charge.activity webhook event, remove buyer_id
2.0.23Add `errorFields` attribute for 400 errors to indicate invalid input fields
2.0.24Add `cancellation_comment` attribute for Cancel a charge
2.0.25Add `missing_program` error code for Create a charge
2.0.26Add more description under Pre-authorization
2.0.27update transaction_date description in daily.charge.activity webhook
2.0.28Add terms and conditions endpoinnt
2.0.29Add `Miskey, Paid To Client Direct`, `Unauthorized Purchase`, `Customer Tax Exempt Or Incorrect Tax` to CancellationReason
2.0.30Add `invalid_terms_and_conditions_id` and `require_terms_and_conditions_id` error code for buyer_application
2.0.31Add the seller.payment.settled webhook event
2.0.32Make annual_income and date_of_birth not required when company type is Sole Proprietor
2.0.33Add company_annual_revenue to buyer application
2.0.34Add pattern match for company_annual_revenue to buyer application
2.0.35Add buyer_id and client_reference_id to preauthorization.updated webhook response
2.0.36Update the sample payload for preauthorization.updated webhook

Introduction

MSTS provides a safe and easy way to extend credit to your business customers. We are aiming to provide the easiest B2B payment flow with straightforward integration with your e-commerce application.

The following image shows the integration flow for a standalone e-commerce application:

alt text

If your application involves a marketplace, the integration will be slightly different:

alt text

Once you are ready to integrate, you can follow the following steps:

Step 1. Create your API key

Login to https://app.msts.credit. Navigate to the API Keys screen by clicking the API Keys menu item in the menu. If your account has access to multiple programs, then you will need to select the program (located in the upper right of the screen). Click NEW API KEY button to create an API Key. When the key is generated, place the detail in secure storage. MSTS cannot reverse engineer your API key.

The API key must be used for all server-side interactions. The API key MUST NOT be used for client-side interactions.

Step 2. Register a webhook to receive important notifications

MSTS will notify you about new/changed buyers and payments. The buyer notification provides the ID to use when later referencing buyers.

MSTS will make best efforts to ensure you receive every notification. A HTTP response in the range of 200 to 299 will assist, letting us know not to try again.

MSTS operates two environments for you (Test and Production). They are identified by API key. Each environment has its own webhook.

Step 3. Register buyers

MSTS provides two ways to register buyers. Buyers can complete a MSTS credit application form or alternatively you can submit a server-side API request.

The specification for buyer credit application API lists all the required data to register buyer and apply for credit.

For the MSTS application form, buyers will be provided with a link to navigate to the form. The link contains the URL and query parameters that will pre-populate some fields in the application form. The supported parameters are:

client_reference_id : Required parameter - The ID to identify the buyer in your program.

first_transacted_date : Optional parameter - The first transaction date of the buyer in your program. The date must be in YYYY-MM-DD format.

total_transacted_amount : Optional parameter - The total transaction amount of the buyer.

current_transaction_amount : Optional parameter - The current transaction amount in the shopping cart.

ecommerce_url : Optional parameter - The URL for the buyer to return to the ecommerce site.

An example link with query parameter is as follows https://my_program.msts.credit/apply?client_reference_id=123456&first_transacted_date=2017-01-30&total_transacted_amount=10000

You will need to generate the URL for each buyer, so they can visit the form with necessary query parameters. You will include a link in your site for the buyer to apply for credit.

Step 4. Modify your ecommerce site to integrate auth/charge API's.

Your site needs to include a way to apply for credit as described in Step 3.

Your site also needs to offer the payment method during checkout. This might be displayed when buyers have an approved credit line (see Step 2).

When a buyer selects the payment method, your site will optionally submit a server-side API request to pre-authorize the amount. This locks the amount from being used for other purchases.

When you fulfill an order, your site will submit a server-side API request to charge the buyer. This may reference a pre-authorization. A charge can exceed the pre-authorization amount upto the buyers available credit.

4.1. Pre-authorization (optional)

A pre-authorization places a temporary lock on an amount of credit with a buyer. It ensures that these funds are available to charge when an order is fulfilled.

A single pre-authorization can be used for multiple charges. This provides flexibility to charge incrementally as an order is fulfilled.

Best practice is to submit a preauthorization before submitting a charge. This blocks an amount on the buyer's credit line and verifies that the buyer has enough credit available for the future charge. Preauthorizations will be rejected if the buyer's account is not in an active status. Once a preauthorization is successfully accepted, MSTS will honor that preauthorization regardless of the buyer's account status. Note that preauthorizations will expire after a program specific period of time.

If the seller elects not to submit a preauthorization and only a charge, MSTS will check the buyer's account status and the buyer's available credit before accepting the charge. If the buyer does not have the necessary credit available or is not in an active status, the charge will be rejected.

4.2. Charges

Charges initiate seller payments and buyer invoices. Where a pre-authorization was used, you need to include the id of the pre-authorization to reduce the pre-authorized amount remaining.

4.3. Pre-authorization cancellations

A pre-authorization can be cancelled. Cancellation will free any remaining credit that is locked by this pre-authorization.

4.4. Cancel Charges

A charge must be cancelled when an order is cancelled or partially refunded. If creating a new charge for a revised amount (in the case of refunds) include the previous charge id. MSTS will refund the seller fee of the original charge. You must specify a comment when creating a charge that references a previous charge. This information will be displayed on the buyers invoice. alt text

Errors

HTTP response codes are used to indicate the success or failure of an API request.

Status Code RangeDescription
2xxIndicates success.
4xxIndicates a bad request was made. Eg. data in the payload provided was not valid.
5xxIndicates an error occurred with our server. This should rarely happen

If an error occurs, an error objects will be returned. The error object contains a code, which could be used to programatically handle the error. A message field is also included, containing a text description of the error. Some 400 errors may also include a validationErrors field containing an array of additional data related to the error. For buyer_application, 400 errors might have errorFields attribute to indicate invalid fields.

Sample error response:

 {
   "code": "invalid_seller",
   "message": "Seller with id '7365581a-eedb-4c96-bbf9-f97bac59f551' is non-existent or inactive."
 }

The list of possible error codes are as follow:

Error CodeDescription
amount_mismatchThe amounts specified in the charge are not equal to the sum of the amounts in charge details
authorization.missing_required_permissionUser does not have the correct role for accessing the API endpoint
authorization.unauthenticated_not_allowedWrong API key. Unauthenticated access not allowed for API endpoint
buyer_already_createdA buyer has already exists
client_reference_id_already_existsThe client reference ID has been used for a buyer in the same program
detail_amount_mismatchThe amounts specified in the charge details are not equal to the subtotal of the detail in charge details
discount_amount_mismatchThe discount amount specified in the charge is not equal to the sum of the discount amount in charge details
email_already_existsThe email has been used for a buyer
internal_errorInternal server error
invalid_buyerBuyer for the given ID does not exist or inactive
invalid_inputOne of the request inputs is not valid
invalid_preauthorizationInvalid preauthorization for the ID specified
invalid_programSeller and Buyer are not in the same program
invalid_poPurchase Order number is invalid or does not match expected format
invalid_sellerSeller for the given ID does not exist or inactive
invalid_shipping_amountShipping amount + shipping tax amount - shipping discount amount can not be less than 0
invalid_terms_and_conditions_idThe terms_and_conditions_id is invalid for this program
method_not_allowedMethod is not allowed
missing_programThe associated Program was not found
new_application_not_allowedThe program is configured to not allow any new applications
po_requiredPurchase Order number is required
preauthorization_amount_too_lowThe updated preauthorization amount is lower than the captured amount.
preauthorization_invalid_amountThe updated preauthorization amount must be less than the original amount.
preauthorization_invalid_statusPreauthorization with Expired, Cancelled or Rejected status can't be cancelled or updated
preauthorization_po_requiredPurchase Order number is required for this buyer's preauthorization
program_not_foundThe program in the buyer application doesn't exist
require_terms_and_conditions_idThe terms_and_conditions_id is required for this program
resource_not_foundNo information is found for the requested ID
return_amount_mismatchThe Sum of return amount plus total amount must equal original amount of charge
return_invalid_amountInvalid return amount. The return amount cannot exceed the charge amount.
return_invalid_chargeInvalid charge for the ID specified
return_invalid_total_amountInvalid total amount - not equal to sum of detail subtotal plus shipping and shipping tax(if provided) minus shipping discount(if provided)
return_invalid_amount_use_refundInvalid return amount - amount equals remaining amount - use Cancel a charge instead
tax_amount_mismatchThe tax amount specified in the charge is not equal to the sum of the tax amount in charge details
unsupported_currencyThe specified currency is not supported for the seller
validation.body_not_matching_json_schemaRequest body failed JSON schema validation
validation.invalid_query_parameterThe value for the query parameter is invalid
validation.invalid_path_parameterThe value for the path parameter is invalid
validation.unsupported_media_typeUnsupported media type
idempotency.invalid_requestThe idempotency key supplied does not match the previous request URL, body and headers
idempotency.invalid_key_usageA idempotency key were supplied for an operation other than POST

Idempotent Requests

Idempotency is supported for all POST operations to enable safely retrying requests without accidentally performing the same operation twice. To perform an idempotent request the client provides an additional Idempotency-Key header containing a unique value (for example a random UUID). The idempotency layer works by saving the resulting status code, headers and body of the first request made for any given idempotency key, regardless of whether it succeeded or failed. Subsequent requests with the same key return the same result, including errors. Requests with the same idempotency key value must have the exact same body, byte for byte, and the same value for the headers Authorization, Content-Type and Content-Length. If the request does not match previous requests with the same key the API will respond with 400 Bad Request containing the error code idempotency.invalid_request. Idempotency keys are remembered for up to 24h so any key that is older than 24h should never be used to retry a request. It is up to the client to generate and keep track of the age of the key. The Idempotency-Key header is only valid for POST operations, supplying the header for any other operation will result in the API responding with 400 Bad Request containing the error code idempotency.invalid_key_usage. The idempotency key is only unique in the scope of an exact match on Authorization header values so two requests with the same API Key, idempotency key and content but were one is using Bearer scheme and one is using Basic scheme will be considered two complitely differrent requests. For example, the different Authorization header values below are considered different in the context of idempotent requests handling.


  Authorization: Bearer 13bdb78c-6169-43de-a6ac-c1c771e4f688
  Authorization: Bearer 13BDB78C-6169-43DE-A6AC-C1C771E4F688
  Authorization: Bearer 13bdb78c616943dea6acc1c771e4f688
  Authorization: Basic MTNiZGI3OGMtNjE2OS00M2RlLWE2YWMtYzFjNzcxZTRmNjg4Og==

Common Variables

Unless otherwise specified, attributes are in the following common formats.

VariableDescriptionExample
dateDates are in ISO 8601/[RFC3339](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) 'full-date' format.2018-01-30
date-timeDates/times are in ISO 8601/[RFC3339](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) 'date-time' format.2018-07-12T02:00:25.535Z
amountsAmounts are in the smallest currency unit unless otherwise specified, for example 100 for JPY 100, 100 for USD 1, 1000 for BHD 1.50000
uuidUUIDs adhere to UUID v4 (random)cf771e8a-5c1a-462f-b4c9-fc745f02d0de
# Authentication Requests are authenticated via bearer authentication. You will need an API Key which can be obtain by following Step 1 in the Introduction section.

The API Key can be used differently depending on the context.

bearerAuth

provide api key in header as Authorisation: Bearer [API KEY]

Security Scheme Type API Key
Header parameter name: Authorization: Bearer [API-KEY]

basicAuth

provide api key as username

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Authentication via HTTP Basic Auth

For example if your API Key is 13bdb78c-6169-43de-a6ac-c1c771e4f688, you provide it as the basic auth username value. You do not need to provide a password.

Example curl GET request using basic auth:

 curl -X GET app.msts.credit/api/v20180807/charges -u 13bdb78c-6169-43de-a6ac-c1c771e4f688: 
The colon on the end stops curl from asking for a password

Authentication via Bearer Auth

The API Key can be provided via a Bearer token header.

For example if your api key is 13bdb78c-6169-43de-a6ac-c1c771e4f688, you would include the 'Authorization' header with the value Bearer 13bdb78c-6169-43de-a6ac-c1c771e4f688.

Example curl GET request with authentication:

 curl -H 'Authorization: Bearer 13bdb78c-6169-43de-a6ac-c1c771e4f688' -H "accept: application/json" -X GET app.msts.credit/api/v20180807/charges/f52cd8cd-3728-44d7-85ff-95efbef46e3d 

API requests must be made over https and must include authentication, or else they will fail.

Preauthorization

Create a preauthorization

Reserves an amount of available credit

Authorizations:
Request Body schema: application/json

The preauthorization to create

seller_id
required
string ^(?:{[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7}}|[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7})$

Universally unique identifier (UUID).

buyer_id
required
string ^(?:{[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7}}|[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7})$

Universally unique identifier (UUID).

currency
required
string

Three-letter ISO currency code in uppercase. Must be a supported currency for the seller.

preauthorized_amount
required
integer [ 1 .. 214748364 ]

Amount to be preauthorized.

po_number
string [ 0 .. 200 ] characters

PO Number. This may be required by some buyers/sellers based on their configuration. Format validations may also be applied based on requirements.

Responses

201

The preauthorization was created successfully

400

Bad request

Error CodeDescription
validation.body_not_matching_json_schemaRequest body failed JSON schema validation
invalid_sellerSeller for the given ID does not exist or inactive
invalid_buyerBuyer for the given ID does not exist or inactive
invalid_programSeller and Buyer are not in the same program
unsupported_currencyThe specified currency is not supported for the seller
preauthorization_po_requiredPurchase Order number is required for this buyer's preauthorization
preauthorization_invalid_poPurchase Order number is invalid or does not match expected format
invalid_inputOne of the request inputs is not valid

401

Authentication is missing or invalid

Error CodeDescription
authorization.unauthenticated_not_allowedUnauthenticated access
402

The preauthorization was rejected because of insufficient credit

403

Permission to the requested resource is denied

Error CodeDescription
authorization.missing_required_permissionUser does not have the correct role for accessing
415

Unsupported media type

Error CodeDescription
validation.unsupported_media_typeUnsupported media type
500

Internal server error

Error CodeDescription
internal_errorInternal server error
502

Bad gateway

Error CodeDescription
bad_gatewayInvalid response from the upstream server
post /preauthorizations
https://app.msts.credit/api/v20180807/preauthorizations

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "seller_id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "buyer_id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "currency": "USD",
  • "preauthorized_amount": 1,
  • "po_number": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "seller_id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "buyer_id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "currency": "USD",
  • "preauthorized_amount": 1,
  • "captured_amount": 0,
  • "foreign_exchange_fee": 0,
  • "status": "Preauthorized",
  • "po_number": "string",
  • "expires": "2018-07-12T02:00:25.535Z",
  • "created": "2018-07-12T02:00:25.535Z",
  • "modified": "2018-07-12T02:00:25.535Z"
}

Cancel a preauthorization

Cancels a credit reservation

Authorizations:
path Parameters
id
required
string ^(?:{[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7}}|[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7})$
Example: cf771e8a-5c1a-462f-b4c9-fc745f02d0de

The id of the preauthorization. Universally unique identifier (UUID).

Responses

200

The preauthorization was cancelled

400

Bad request

Error CodeDescription
preauthorization_invalid_statusPreauthorization with Expired, Cancelled or Rejected status can't be cancelled or updated
invalid_inputOne of the request inputs is not valid

401

Authentication is missing or invalid

Error CodeDescription
authorization.unauthenticated_not_allowedUnauthenticated access
403

Permission to the requested resource is denied

Error CodeDescription
authorization.missing_required_permissionUser does not have the correct role for accessing
404

Not found

Error CodeDescription
resource_not_foundNo information is found for the requested ID
500

Internal server error

Error CodeDescription
internal_errorInternal server error
delete /preauthorizations/{id}
https://app.msts.credit/api/v20180807/preauthorizations/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "seller_id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "buyer_id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "currency": "USD",
  • "preauthorized_amount": 1,
  • "captured_amount": 0,
  • "foreign_exchange_fee": 0,
  • "status": "Preauthorized",
  • "po_number": "string",
  • "expires": "2018-07-12T02:00:25.535Z",
  • "created": "2018-07-12T02:00:25.535Z",
  • "modified": "2018-07-12T02:00:25.535Z"
}

Update preauthorization amount

Update a preauthorization amount to reduce the reserved credit

Authorizations:
path Parameters
id
required
string
Example: cf771e8a-5c1a-462f-b4c9-fc745f02d0de

The id of the preauthorization. Universally unique identifier (UUID).

Request Body schema: application/json

The new amount of the preauthorization.

preauthorized_amount
required
integer [ 1 .. 214748364 ]

The preauthorization amount to update to. The updated amount can not be greater than previous preauthorization amount. The updated amount can not less than the captured amount that has been used by charges.

Responses

201

The preauthorization amount was updated

400

Bad request

Error CodeDescription
validation.body_not_matching_json_schemaRequest body failed JSON schema validation
preauthorization_invalid_statusPreauthorization with Expired, Cancelled or Rejected status can't be cancelled or updated
preauthorization_invalid_amountThe updated preauthorization amount cannot exceed the original amount.
preauthorization_amount_too_lowThe updated preauthorization amount is lower than the captured amount.
invalid_inputOne of the request inputs is not valid

401

Authentication is missing or invalid

Error CodeDescription
authorization.unauthenticated_not_allowedUnauthenticated access
403

Permission to the requested resource is denied

Error CodeDescription
authorization.missing_required_permissionUser does not have the correct role for accessing
404

Not found

Error CodeDescription
resource_not_foundNo information is found for the requested ID
415

Unsupported media type

Error CodeDescription
validation.unsupported_media_typeUnsupported media type
500

Internal server error

Error CodeDescription
internal_errorInternal server error
502

Bad gateway

Error CodeDescription
bad_gatewayInvalid response from the upstream server
post /preauthorizations/{id}
https://app.msts.credit/api/v20180807/preauthorizations/{id}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "preauthorized_amount": 1
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "seller_id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "buyer_id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "currency": "USD",
  • "preauthorized_amount": 1,
  • "captured_amount": 0,
  • "foreign_exchange_fee": 0,
  • "status": "Preauthorized",
  • "po_number": "string",
  • "expires": "2018-07-12T02:00:25.535Z",
  • "created": "2018-07-12T02:00:25.535Z",
  • "modified": "2018-07-12T02:00:25.535Z"
}

Charge

Create a charge

Capture an amount from available credit

Authorizations:
Request Body schema: application/json

The charge to create.

seller_id
required
string ^(?:{[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7}}|[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7})$

Universally unique identifier (UUID).

buyer_id
required
string ^(?:{[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7}}|[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7})$

Universally unique identifier (UUID).

currency
required
string

Three-letter ISO currency code in uppercase. Must be a supported currency for the seller.

total_amount
required
integer [ 1 .. 214748364 ]

The total amount of the charge. It includes the sum of all details subtotal + shipping amount + shipping tax amount - shipping discount amount + foreign exchange fee.

tax_amount
required
integer [ 0 .. 214748364 ]

Sum of the tax amount in each detail.

shipping_amount
integer [ 0 .. 214748364 ]

Shipping amount of the charge.

shipping_tax_amount
integer [ 0 .. 214748364 ]

The tax on the shipping amount. Use this attribute to specify shipping tax amount if shipping amount is not including tax.

shipping_discount_amount
integer [ 0 .. 214748364 ]

The discount on the shipping amount. Use this attribute to specify shipping discount amount if shipping amount is not including discount.

discount_amount
integer [ 0 .. 214748364 ]

Sum of the discount amount in each detail.

order_url
required
string <url>

The URL of the order on the ecommerce site.

order_number
required
string

Specific order number generated from ecommerce site.

po_number
string [ 0 .. 200 ] characters

PO Number. This may be required by some buyers/sellers based on their configuration. Format validations may also be applied based on requirements.

preauthorization_id
string ^(?:{[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7}}|[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7})$

The id of the preauthorization for this charge. Universally unique identifier (UUID).

previous_charge_id
string ^(?:{[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7}}|[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7})$

The id of a charge related to this charge. This is normally use to identify a charge that was cancelled and recreated as the current charge. Universally unique identifier (UUID).

comment
string [ 0 .. 1000 ] characters

Comments for this charge.

details
required
Array of objects (ChargeDetails)
metadata
Array of objects (ChargeMetaData) [ 1 .. 5 ] items
supplier
object (Supplier)

The supplier information to show on the invoice

ship_to
object (ShipTo)

The ship to information to show on the invoice

Responses

201

The new charge was created successfully

400

Bad request

Error CodeDescription
validation.body_not_matching_json_schemaRequest body failed JSON schema validation
invalid_sellerSeller for the given ID does not exist or inactive
invalid_buyerBuyer for the given ID does not exist or inactive
invalid_programSeller and Buyer are not in the same program
missing_programThe associated Program was not found
unsupported_currencyThe specified currency is not supported for the seller
invalid_preauthorizationInvalid preauthorization for the ID specified
amount_mismatchThe amounts specified in the charge are not equal to the sum of the amounts in charge details
detail_amount_mismatchThe amounts specified in the charge details are not equal to the subtotal of the detail in charge details
po_requiredPurchase Order number is required
invalid_poPurchase Order number is invalid or does not match expected format
invalid_inputOne of the request inputs is not valid
tax_amount_mismatchThe tax amount specified in the charge is not equal to the sum of the tax amount in charge details
discount_amount_mismatchThe discount amount specified in the charge is not equal to the sum of the discount amount in charge details
invalid_shipping_amountShipping amount + shipping tax amount - shipping discount amount can not be less than 0
401

Authentication is missing or invalid

Error CodeDescription
authorization.unauthenticated_not_allowedUnauthenticated access
402

The charge was rejected because of insufficient credit

403

Permission to the requested resource is denied

Error CodeDescription
authorization.missing_required_permissionUser does not have the correct role for accessing
415

Unsupported media type

Error CodeDescription
validation.unsupported_media_typeUnsupported media type
500

Internal server error

Error CodeDescription
internal_errorInternal server error
502

Bad gateway

Error CodeDescription
bad_gatewayInvalid response from the upstream server
post /charges
https://app.msts.credit/api/v20180807/charges

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "seller_id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "buyer_id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "currency": "USD",
  • "total_amount": 1,
  • "tax_amount": 0,
  • "shipping_amount": 0,
  • "shipping_tax_amount": 0,
  • "shipping_discount_amount": 0,
  • "discount_amount": 0,
  • "order_url": "string",
  • "order_number": "string",
  • "po_number": "string",
  • "preauthorization_id": "cf771e8a-5c1a-462f-b4c9-fc745f02d0de",
  • "previous_charge_id"