TABLE OF CONTENTS


Sale Transaction

This API is used in order to charge a customer for a set amount. This API depends on having a Token.


Once you have a token, you can use the sale API to charge the customer.  After completing the sale you can use the Refund API in order to refund the transaction. 

POST v1/payment/{mid}/sale

Request Parameters

The merchant ID of the seller performing the sale.


Request Body

Include a SaleRequest object as the body of the request.


Sample Request

POST https://sandX-api.acmeticketing.net/v1/payment/987-654-321/sale


Response

Returns a SaleResponse object or an error for the failed transaction.


SaleRequest Object


NameTypeDescriptionRequired
tokenstringEither a single use or a multi use tokenToken or externalPaymentMethodId Required
externalPaymentMethodIdstringPlain text value provided during token creation which represents the token.
Token or externalPaymentMethodId Required
chargeCharge objectThe charge object for this sale.  The amount is requiredRequired
externalIdstringPlain text value provided for this sale.  Max 255 char. Cannot contain %, <, >, http:, https:, /, \\Optional


Charge Object


NameTypeDescriptionRequired
amountnumberThe amount of money the sale or refund is for.  2 decimal places are supported Required



SaleResponse Object


NameTypeDescription
saleIdstringUnique identifier for this transaction
card
Card ObjectThe details of the credit card
externalId
stringPlain text value provided for this sale. 




Sample Request Body

Sale by Token 

{
  "token" : "123-456-789",
  "charge": {
    "amount" : 50.00
  },
  "externalId": "BSYE623048"
}

Sale by External Payment Method

{
  "externalPaymentMethodId" : "PMID-123",
  "charge": {
    "amount" : 50.00
  },
  "externalId": "BSYE623048"
}


Sample Response Body


Successful Sale Transaction

{
   "saleId": "sale_123-abc-456",
   "externalId": "BSYE623048",
    "card": {
        "lastFour": "4242",
        "brand": "Visa",
        "firstName": "John",
        "lastName": "Smith"
    }
}

Failed Sale Transaction 

If the error happens at ACME there will not be a processor or issuing error code.  If the error happens at the issuing bank then both of those should be available.  If it happens at the payment processor, then there will probably not be an issuing error but there will be a processor error.

{
    "message": "Please enter the correct ZIP / Postal Code for your credit card",
    "errorCode": 6107,
    "type": "INCORRECT_ZIP",
    "processorErrorCode": "incorrect_zip",
    "processorErrorMessage": "The zip code you supplied failed validation.",
    "issuingErrorCode": "incorrect_zip",
    "issuingErrorMessage": "The zip code you supplied failed validation.",
    "requestId": "04b7ae82-a0a4-11ec-ab96-064a412857e4"
}