{"openapi":"3.1.0","info":{"title":"Reccurs Merchant API","version":"v1","description":"Create one-time IDR orders, share their hosted payment link, and receive signed webhooks. v1 changes only additively: new response fields, event types, enum values, error codes and optional parameters may appear without notice, so ignore what you do not recognize and treat IDs and URLs as opaque."},"servers":[{"url":"https://api.reccurs.com","description":"Live, with rk_live_ keys"},{"url":"https://sandbox-api.reccurs.com","description":"Test, with rk_test_ keys"}],"security":[{"apiKey":[]}],"paths":{"/v1/orders":{"post":{"operationId":"createOrder","summary":"Create an order","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Up to 200 visible ASCII characters, honored for at least 24 hours. Derive it from your own order ID so a retry cannot create a second order.","schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"200":{"description":"The order, new or replayed for the same key and body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"A parameter is missing, unknown or invalid; see param.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, invalid, revoked, or from the other environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The merchant is not enabled for one-time payments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The Idempotency-Key was already used with a different body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this key. Retry after the number of seconds in Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"503":{"description":"The merchant API is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listOrders","summary":"List orders, newest first","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"starting_after","in":"query","schema":{"type":"string"}},{"name":"ending_before","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["open","paid","expired","canceled"]}},{"name":"external_reference","in":"query","schema":{"type":"string","maxLength":120}}],"responses":{"200":{"description":"One page of orders.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderList"}}}},"400":{"description":"A query parameter is unknown or invalid; see param.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, invalid, revoked, or from the other environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this key. Retry after the number of seconds in Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"503":{"description":"The merchant API is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orders/{id}":{"get":{"operationId":"getOrder","summary":"Retrieve an order","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","maxLength":255},"description":"An order ID such as ord_3f2a9c1e7b6d4e0f8a1b2c3d4e5f6a7b."}],"responses":{"200":{"description":"The order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"description":"The API key is missing, invalid, revoked, or from the other environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this key. Retry after the number of seconds in Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"503":{"description":"The merchant API is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orders/{id}/cancel":{"post":{"operationId":"cancelOrder","summary":"Cancel an open order","description":"Stops the payment link at once. A payment already in progress is closed with the provider first; if that cannot be confirmed yet, the response is 409 order_cancel_pending and the order is canceled once the payment ends. Canceling a canceled order returns it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","maxLength":255},"description":"An order ID such as ord_3f2a9c1e7b6d4e0f8a1b2c3d4e5f6a7b."}],"responses":{"200":{"description":"The canceled order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"description":"The API key is missing, invalid, revoked, or from the other environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"order_not_cancelable (paid or expired) or order_cancel_pending.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this key. Retry after the number of seconds in Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}},"503":{"description":"The merchant API is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"order.paid":{"post":{"summary":"The order was paid in full","description":"Signed with Standard Webhooks: verify webhook-signature over webhook-id, webhook-timestamp and the raw body with your whsec_ secret. Deduplicate by event ID.","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Event"},{"properties":{"type":{"const":"order.paid"}}}]}}}},"responses":{"2XX":{"description":"Any 2xx response acknowledges the delivery."}}}},"order.expired":{"post":{"summary":"The order expired without payment","description":"Signed with Standard Webhooks: verify webhook-signature over webhook-id, webhook-timestamp and the raw body with your whsec_ secret. Deduplicate by event ID.","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Event"},{"properties":{"type":{"const":"order.expired"}}}]}}}},"responses":{"2XX":{"description":"Any 2xx response acknowledges the delivery."}}}},"order.canceled":{"post":{"summary":"The order was canceled without payment","description":"Signed with Standard Webhooks: verify webhook-signature over webhook-id, webhook-timestamp and the raw body with your whsec_ secret. Deduplicate by event ID.","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Event"},{"properties":{"type":{"const":"order.canceled"}}}]}}}},"responses":{"2XX":{"description":"Any 2xx response acknowledges the delivery."}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"A secret key, rk_live_… or rk_test_…, from the Reccurs dashboard."}},"schemas":{"Order":{"type":"object","required":["id","object","status","amount","currency","description","external_reference","metadata","customer","customer_details","url","return_url","expires_at","paid_at","created_at"],"properties":{"id":{"type":"string","maxLength":255},"object":{"const":"order"},"status":{"type":"string","enum":["open","paid","expired","canceled"],"description":"paid, expired and canceled are final."},"amount":{"type":"integer","description":"The total the payer pays, in hundredths of a rupiah.","minimum":100000,"maximum":100000000,"multipleOf":100},"currency":{"const":"IDR"},"description":{"type":"string"},"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"customer":{"anyOf":[{"type":"string"},{"type":"null"}]},"customer_details":{"anyOf":[{"type":"object","required":["external_reference","name","email","phone"],"properties":{"external_reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"url":{"type":"string","format":"uri","description":"The order's hosted payment page; it never changes."},"return_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}}},"OrderList":{"type":"object","required":["object","data","has_more"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"has_more":{"type":"boolean"}}},"CreateOrderRequest":{"type":"object","additionalProperties":false,"required":["amount","currency","description"],"properties":{"amount":{"type":"integer","minimum":100000,"maximum":100000000,"multipleOf":100},"currency":{"const":"IDR"},"description":{"type":"string","minLength":1,"maxLength":2000},"external_reference":{"type":"string","minLength":1,"maxLength":120},"return_url":{"type":"string","format":"uri","maxLength":2048,"description":"HTTPS. A literal {ORDER_ID} is replaced with the order ID."},"expires_at":{"type":"string","format":"date-time","description":"30 minutes to 7 days ahead, with a time zone. Defaults to 24 hours."},"metadata":{"type":"object","maxProperties":50,"propertyNames":{"minLength":1,"maxLength":40},"additionalProperties":{"type":"string","maxLength":500}},"customer":{"type":"string","description":"An existing customer ID."},"customer_details":{"type":"object","additionalProperties":false,"required":["external_reference"],"properties":{"external_reference":{"type":"string","minLength":1,"maxLength":120},"name":{"type":"string","maxLength":200},"email":{"type":"string","format":"email","maxLength":254},"phone":{"type":"string","pattern":"^\\+[1-9]\\d{6,14}$","description":"E.164, for example +6281234567890."}}}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"parameter_missing, parameter_invalid, parameter_unknown, idempotency_key_reused, resource_missing, order_not_cancelable, order_cancel_pending, api_key_invalid, api_key_wrong_environment, rate_limited, merchant_not_enabled, state_conflict, service_unavailable or internal_error. More may be added."},"message":{"type":"string"},"param":{"type":"string"},"request_id":{"type":"string"}}}}},"Event":{"type":"object","required":["id","object","type","api_version","created_at","data"],"properties":{"id":{"type":"string"},"object":{"const":"event"},"type":{"type":"string","enum":["order.paid","order.expired","order.canceled"]},"api_version":{"const":"v1"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","required":["object"],"properties":{"object":{"$ref":"#/components/schemas/Order"}}}}}}}}