@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Giftcard Hub API
@base https://apiexamples.vtexcommercestable.com.br
@version 1.0
@auth ApiKey X-VTEX-API-AppKey in header | ApiKey X-VTEX-API-AppToken in header | ApiKey VtexIdclientAutCookie in header
@common_fields {Content-Type: str=application/json, Accept: str=application/json}
@endpoints 15
@toc api(15)

@endpoint GET /api/giftcardproviders
@optional {REST-Range: str=resources=0-49}
@returns(200)

@endpoint GET /api/giftcardproviders/{giftCardProviderId}
@required {giftCardProviderId: str}
@returns(200) {id: str, serviceUrl: str, oauthProvider: str, caption: str, preAuthEnabled: bool, cancelEnabled: bool, _self: map}
@errors {500}

@endpoint PUT /api/giftcardproviders/{giftCardProviderId}
@required {giftCardProviderId: str}
@returns(200) {id: str, serviceUrl: str, oauthProvider: str, preAuthEnabled: bool, cancelEnabled: bool, _self: map}

@endpoint DELETE /api/giftcardproviders/{giftCardProviderId}
@required {giftCardProviderId: str}
@returns(200)
@errors {404}

@endpoint POST /api/giftcardproviders/{giftCardProviderId}/giftcards
@required {giftCardProviderId: str}
@returns(200) {id: str, emissionDate: str, expiringDate: str, caption: str, provider: str, discount: bool, currencyCode: str, transaction: map{href: str}}

@endpoint POST /api/giftcardproviders/{giftCardProviderId}/giftcards/_search
@required {giftCardProviderId: str}
@optional {REST-Range: str=resources=0-49}
@returns(200)

@endpoint GET /api/giftcardproviders/{giftCardProviderId}/giftcards/{giftCardId}
@required {giftCardProviderId: str, giftCardId: str}
@returns(200) {id: str, redemptionToken: str, redemptionCode: str, balance: num, emissionDate: str, expiringDate: str, currencyCode: str, discount: bool, transactions: map{href: str}}

@endpoint GET /api/giftcardproviders/{giftCardProviderId}/giftcards/{giftCardId}/transactions
@required {giftCardProviderId: str, giftCardId: str}
@returns(200)

@endpoint POST /api/giftcardproviders/{giftCardProviderId}/giftcards/{giftCardId}/transactions
@required {giftCardProviderId: str, giftCardId: str}
@returns(200) {cardId: str, id: str, _self: map{href: str}}

@endpoint GET /api/giftcardproviders/{giftCardProviderId}/giftcards/{giftCardId}/transactions/{transactionId}
@required {giftCardProviderId: str, giftCardId: str, transactionId: str}
@returns(200) {value: num, description: str, date: str, requestId: str, settlement: map{href: str}, cancellation: map{href: str}, authorization: map{href: str}, operation: str}

@endpoint GET /api/giftcardproviders/{giftCardProviderId}/giftcards/{giftCardId}/transactions/{tId}/authorization
@required {giftCardProviderId: str, giftCardId: str, tId: str}
@returns(200) {oid: str, value: num, date: str}

@endpoint GET /api/giftcardproviders/{giftCardProviderId}/giftcards/{giftCardId}/transactions/{tId}/settlements
@required {giftCardProviderId: str, giftCardId: str, tId: str}
@returns(200)

@endpoint POST /api/giftcardproviders/{giftCardProviderId}/giftcards/{giftCardId}/transactions/{tId}/settlements
@required {giftCardProviderId: str, giftCardId: str, tId: str, value: num, requestId: str}
@returns(200)

@endpoint GET /api/giftcardproviders/{giftCardProviderId}/giftcards/{giftCardId}/transactions/{tId}/cancellations
@required {giftCardProviderId: str, giftCardId: str, tId: str}
@returns(200)

@endpoint POST /api/giftcardproviders/{giftCardProviderId}/giftcards/{giftCardId}/transactions/{tId}/cancellations
@required {giftCardProviderId: str, giftCardId: str, tId: str}
@returns(200) {oid: str, value: num, date: str}

@end
