@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Adyen Stored Value API
@base https://pal-test.adyen.com/pal/servlet/StoredValue/v46
@version 46
@auth ApiKey X-API-Key in header | Bearer basic
@common_fields {merchantAccount: str # The merchant account identifier, with which you want to process the transaction., reference: str # The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens ("-"). Maximum length: 80 characters., store: str # The physical store, for which this payment is processed.}
@endpoints 6
@toc changeStatus(1), checkBalance(1), issue(1), load(1), mergeBalance(1), voidTransaction(1)

@group changeStatus
@endpoint POST /changeStatus
@desc Changes the status of the payment method.
@required {paymentMethod: map # The collection that contains the type of the payment method and its specific information if available, status: str(active/inactive) # The status you want to change to}
@optional {amount: map{currency!: str, value!: int(int64)}, recurringDetailReference: str, shopperInteraction: str(Ecommerce/ContAuth/Moto/POS) # Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default.  This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal., shopperReference: str}
@returns(200) {authCode: str, currentBalance: map{currency: str, value: int(int64)}, pspReference: str, refusalReason: str, resultCode: str, thirdPartyRefusalReason: str} # OK - the request has succeeded.
@errors {400: Bad Request - a problem reading or understanding the request., 401: Unauthorized - authentication required., 403: Forbidden - insufficient permissions to process the request., 500: Internal Server Error - the server could not process the request.}

@endgroup

@group checkBalance
@endpoint POST /checkBalance
@desc Checks the balance.
@required {paymentMethod: map # The collection that contains the type of the payment method and its specific information if available}
@optional {amount: map{currency!: str, value!: int(int64)}, recurringDetailReference: str, shopperInteraction: str(Ecommerce/ContAuth/Moto/POS) # Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default.  This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal., shopperReference: str}
@returns(200) {currentBalance: map{currency: str, value: int(int64)}, pspReference: str, refusalReason: str, resultCode: str, thirdPartyRefusalReason: str} # OK - the request has succeeded.
@errors {400: Bad Request - a problem reading or understanding the request., 401: Unauthorized - authentication required., 403: Forbidden - insufficient permissions to process the request., 500: Internal Server Error - the server could not process the request.}

@endgroup

@group issue
@endpoint POST /issue
@desc Issues a new card.
@required {paymentMethod: map # The collection that contains the type of the payment method and its specific information if available}
@optional {amount: map{currency!: str, value!: int(int64)}, recurringDetailReference: str, shopperInteraction: str(Ecommerce/ContAuth/Moto/POS) # Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default.  This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal., shopperReference: str}
@returns(200) {authCode: str, currentBalance: map{currency: str, value: int(int64)}, paymentMethod: map, pspReference: str, refusalReason: str, resultCode: str, thirdPartyRefusalReason: str} # OK - the request has succeeded.
@errors {400: Bad Request - a problem reading or understanding the request., 401: Unauthorized - authentication required., 403: Forbidden - insufficient permissions to process the request., 500: Internal Server Error - the server could not process the request.}

@endgroup

@group load
@endpoint POST /load
@desc Loads the payment method.
@required {amount: map{currency!: str, value!: int(int64)}, paymentMethod: map # The collection that contains the type of the payment method and its specific information if available}
@optional {loadType: str(merchandiseReturn/load) # The type of load you are trying to do, when absent we default to 'Load', recurringDetailReference: str, shopperInteraction: str(Ecommerce/ContAuth/Moto/POS) # Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default.  This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal., shopperReference: str}
@returns(200) {authCode: str, currentBalance: map{currency: str, value: int(int64)}, pspReference: str, refusalReason: str, resultCode: str, thirdPartyRefusalReason: str} # OK - the request has succeeded.
@errors {400: Bad Request - a problem reading or understanding the request., 401: Unauthorized - authentication required., 403: Forbidden - insufficient permissions to process the request., 500: Internal Server Error - the server could not process the request.}

@endgroup

@group mergeBalance
@endpoint POST /mergeBalance
@desc Merge the balance of two cards.
@required {paymentMethod: map # The collection that contains the type of the payment method and its specific information if available, sourcePaymentMethod: map # The collection that contains the source payment method and its specific information if available. Note that type should not be included since it is inferred from the (target) payment method}
@optional {amount: map{currency!: str, value!: int(int64)}, recurringDetailReference: str, shopperInteraction: str(Ecommerce/ContAuth/Moto/POS) # Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default.  This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal., shopperReference: str}
@returns(200) {authCode: str, currentBalance: map{currency: str, value: int(int64)}, pspReference: str, refusalReason: str, resultCode: str, thirdPartyRefusalReason: str} # OK - the request has succeeded.
@errors {400: Bad Request - a problem reading or understanding the request., 401: Unauthorized - authentication required., 403: Forbidden - insufficient permissions to process the request., 500: Internal Server Error - the server could not process the request.}

@endgroup

@group voidTransaction
@endpoint POST /voidTransaction
@desc Voids a transaction.
@required {originalReference: str # The original pspReference of the payment to modify.}
@optional {tenderReference: str # The reference of the tender., uniqueTerminalId: str # The unique ID of a POS terminal.}
@returns(200) {currentBalance: map{currency: str, value: int(int64)}, pspReference: str, refusalReason: str, resultCode: str, thirdPartyRefusalReason: str} # OK - the request has succeeded.
@errors {400: Bad Request - a problem reading or understanding the request., 401: Unauthorized - authentication required., 403: Forbidden - insufficient permissions to process the request., 500: Internal Server Error - the server could not process the request.}

@endgroup

@end
